diff options
author | Alessandro Portale <aportale@trolltech.com> | 2009-06-03 12:32:12 (GMT) |
---|---|---|
committer | Alessandro Portale <aportale@trolltech.com> | 2009-06-03 12:32:12 (GMT) |
commit | 3524dcecdd7d3fef48932f17814bf4a2ecd2cda7 (patch) | |
tree | 294ba02513110e42377b5a140fc6cf03cd31c857 /src/gui/inputmethod/qcoefepinputcontext_s60.cpp | |
parent | 9db0d28080b4b08ef484e2fb767e20a2754f537d (diff) | |
parent | 3d05a836cb0bc62e6dc31d297bada07ec60adc34 (diff) | |
download | Qt-3524dcecdd7d3fef48932f17814bf4a2ecd2cda7.zip Qt-3524dcecdd7d3fef48932f17814bf4a2ecd2cda7.tar.gz Qt-3524dcecdd7d3fef48932f17814bf4a2ecd2cda7.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/gui/inputmethod/qcoefepinputcontext_s60.cpp')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 8612e55..0a5fd22 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -13,6 +43,7 @@ #include "qcoefepinputcontext_p.h" #include <qapplication.h> +#include <private/qapplication_p.h> #include <qtextformat.h> #include <fepitfr.h> @@ -59,9 +90,12 @@ QCoeFepInputContext::~QCoeFepInputContext() // This is to make sure that the FEP manager "forgets" about us, // otherwise we may get callbacks even after we're destroyed. // The call is asynchronous though, so we must spin the event loop - // to make sure it gets detected. + // to make sure it gets detected. However we will not spin eventloop + // in case that app is closing, since eventDispatcher is already deleted. CCoeEnv::Static()->InputCapabilitiesChanged(); - QApplication::processEvents(); + if(!QApplicationPrivate::is_app_closing) { + QApplication::processEvents(); + } if (m_fepState) delete m_fepState; @@ -606,13 +640,13 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur if (!w) return; - int pos = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + aCursorSelection.iCursorPos + 1; + int pos = aCursorSelection.iAnchorPos; + int length = aCursorSelection.iCursorPos - pos; QList<QInputMethodEvent::Attribute> attributes; - attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, pos, 1, QVariant()); + attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, length, QVariant()); QInputMethodEvent event(m_preeditString, attributes); - // ### FIXME Sets preeditcursor and not cursor. Probably needs new API. - //sendEvent(event); + sendEvent(event); } void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const @@ -621,9 +655,8 @@ void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSele if (!w) return; - QVariant cursorVar = w->inputMethodQuery(Qt::ImCursorPosition); - int cursor = cursorVar.toInt() + m_preeditString.size(); - int anchor = cursor - w->inputMethodQuery(Qt::ImCurrentSelection).toString().size(); + int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size(); + int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size(); aCursorSelection.iAnchorPos = anchor; aCursorSelection.iCursorPos = cursor; } |