Commit cafc2a861b139c33d3989c625deb76a874159fbe
- Diff rendering mode:
- inline
- side by side
src/gui/inputmethod/qcoefepinputcontext_p.h
(1 / 1)
|   | |||
| 96 | 96 | void timerEvent(QTimerEvent *timerEvent); | |
| 97 | 97 | ||
| 98 | 98 | private: | |
| 99 | void commitCurrentString(bool triggeredBySymbian); | ||
| 99 | void commitCurrentString(bool cancelFepTransaction); | ||
| 100 | 100 | void updateHints(bool mustUpdateInputCapabilities); | |
| 101 | 101 | void applyHints(Qt::InputMethodHints hints); | |
| 102 | 102 | void applyFormat(QList<QInputMethodEvent::Attribute> *attributes); |
src/gui/inputmethod/qcoefepinputcontext_s60.cpp
(9 / 8)
|   | |||
| 100 | 100 | ||
| 101 | 101 | void QCoeFepInputContext::reset() | |
| 102 | 102 | { | |
| 103 | commitCurrentString(false); | ||
| 103 | commitCurrentString(true); | ||
| 104 | 104 | } | |
| 105 | 105 | ||
| 106 | 106 | void QCoeFepInputContext::ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType) | |
| … | … | ||
| 125 | 125 | ||
| 126 | 126 | void QCoeFepInputContext::setFocusWidget(QWidget *w) | |
| 127 | 127 | { | |
| 128 | commitCurrentString(false); | ||
| 128 | commitCurrentString(true); | ||
| 129 | 129 | ||
| 130 | 130 | QInputContext::setFocusWidget(w); | |
| 131 | 131 | ||
| … | … | ||
| 218 | 218 | break; | |
| 219 | 219 | case Qt::Key_Select: | |
| 220 | 220 | if (!m_preeditString.isEmpty()) { | |
| 221 | commitCurrentString(false); | ||
| 221 | commitCurrentString(true); | ||
| 222 | 222 | return true; | |
| 223 | 223 | } | |
| 224 | 224 | break; | |
| … | … | ||
| 230 | 230 | && focusWidget()->inputMethodHints() & Qt::ImhHiddenText | |
| 231 | 231 | && !keyEvent->text().isEmpty()) { | |
| 232 | 232 | // Send some temporary preedit text in order to make text visible for a moment. | |
| 233 | m_cursorPos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); | ||
| 233 | 234 | m_preeditString = keyEvent->text(); | |
| 234 | 235 | QList<QInputMethodEvent::Attribute> attributes; | |
| 235 | 236 | QInputMethodEvent imEvent(m_preeditString, attributes); | |
| … | … | ||
| 293 | 293 | Q_ASSERT(focusWidget()); | |
| 294 | 294 | ||
| 295 | 295 | if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) { | |
| 296 | commitCurrentString(false); | ||
| 296 | commitCurrentString(true); | ||
| 297 | 297 | int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); | |
| 298 | 298 | ||
| 299 | 299 | QList<QInputMethodEvent::Attribute> attributes; | |
| … | … | ||
| 739 | 739 | ||
| 740 | 740 | void QCoeFepInputContext::DoCommitFepInlineEditL() | |
| 741 | 741 | { | |
| 742 | commitCurrentString(true); | ||
| 742 | commitCurrentString(false); | ||
| 743 | 743 | } | |
| 744 | 744 | ||
| 745 | void QCoeFepInputContext::commitCurrentString(bool triggeredBySymbian) | ||
| 745 | void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction) | ||
| 746 | 746 | { | |
| 747 | 747 | int longPress = 0; | |
| 748 | 748 | ||
| 749 | 749 | if (m_preeditString.size() == 0) { | |
| 750 | 750 | QWidget *w = focusWidget(); | |
| 751 | if (triggeredBySymbian && w) { | ||
| 751 | if (!cancelFepTransaction && w) { | ||
| 752 | 752 | // We must replace the last character only if the input box has already accepted one | |
| 753 | 753 | if (w->inputMethodQuery(Qt::ImCursorPosition).toInt() != m_cursorPos) | |
| 754 | 754 | longPress = 1; | |
| … | … | ||
| 765 | 765 | m_hasTempPreeditString = false; | |
| 766 | 766 | longPress = 0; | |
| 767 | 767 | ||
| 768 | if (!triggeredBySymbian) { | ||
| 768 | if (cancelFepTransaction) { | ||
| 769 | 769 | CCoeFep* fep = CCoeEnv::Static()->Fep(); | |
| 770 | 770 | if (fep) | |
| 771 | 771 | fep->CancelTransaction(); |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

