Changeset 651 for trunk/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 73 73 m_pointerHandler(0), 74 74 m_longPress(0), 75 m_cursorPos(0) 75 m_cursorPos(0), 76 m_hasTempPreeditString(false) 76 77 { 77 78 m_fepState->SetObjectProvider(this); … … 101 102 void QCoeFepInputContext::reset() 102 103 { 103 CCoeFep* fep = CCoeEnv::Static()->Fep(); 104 if (fep) 105 fep->CancelTransaction(); 104 commitCurrentString(false); 106 105 } 107 106 … … 201 200 return false; 202 201 203 if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { 202 switch (event->type()) { 203 case QEvent::KeyPress: 204 commitTemporaryPreeditString(); 205 // fall through intended 206 case QEvent::KeyRelease: 204 207 const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event); 205 208 switch (keyEvent->key()) { … … 224 227 break; 225 228 } 229 230 if (keyEvent->type() == QEvent::KeyPress 231 && focusWidget()->inputMethodHints() & Qt::ImhHiddenText 232 && !keyEvent->text().isEmpty()) { 233 // Send some temporary preedit text in order to make text visible for a moment. 234 m_preeditString = keyEvent->text(); 235 QList<QInputMethodEvent::Attribute> attributes; 236 QInputMethodEvent imEvent(m_preeditString, attributes); 237 QApplication::sendEvent(focusWidget(), &imEvent); 238 m_tempPreeditStringTimeout.start(1000, this); 239 m_hasTempPreeditString = true; 240 update(); 241 return true; 242 } 243 break; 226 244 } 227 245 … … 252 270 253 271 return false; 272 } 273 274 void QCoeFepInputContext::timerEvent(QTimerEvent *timerEvent) 275 { 276 if (timerEvent->timerId() == m_tempPreeditStringTimeout.timerId()) 277 commitTemporaryPreeditString(); 278 } 279 280 void QCoeFepInputContext::commitTemporaryPreeditString() 281 { 282 if (m_tempPreeditStringTimeout.isActive()) 283 m_tempPreeditStringTimeout.stop(); 284 285 if (!m_hasTempPreeditString) 286 return; 287 288 commitCurrentString(false); 254 289 } 255 290 … … 310 345 { 311 346 using namespace Qt; 347 348 commitTemporaryPreeditString(); 312 349 313 350 bool numbersOnly = hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly … … 502 539 return; 503 540 541 commitTemporaryPreeditString(); 542 504 543 m_cursorPos = w->inputMethodQuery(Qt::ImCursorPosition).toInt(); 505 544 … … 600 639 if (!w) 601 640 return; 641 642 commitTemporaryPreeditString(); 602 643 603 644 int pos = aCursorSelection.iAnchorPos; … … 720 761 sendEvent(event); 721 762 763 m_hasTempPreeditString = false; 722 764 m_longPress = 0; 723 765
Note:
See TracChangeset
for help on using the changeset viewer.