diff options
author | axis <qt-info@nokia.com> | 2009-06-03 11:17:16 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-06-03 11:17:16 (GMT) |
commit | 3d05a836cb0bc62e6dc31d297bada07ec60adc34 (patch) | |
tree | 21f3dc65344c2e094708615cbd430166f021ad65 /src/gui/inputmethod | |
parent | 612ebdbf04161b4768fc7a2800fbf0c7b73dd424 (diff) | |
parent | 3592724b1f7e635904c31ba09a61d6b7259c93e5 (diff) | |
download | Qt-3d05a836cb0bc62e6dc31d297bada07ec60adc34.zip Qt-3d05a836cb0bc62e6dc31d297bada07ec60adc34.tar.gz Qt-3d05a836cb0bc62e6dc31d297bada07ec60adc34.tar.bz2 |
Merge branch 'imSelections'
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_p.h | 32 | ||||
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 45 |
2 files changed, 68 insertions, 9 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index 50f8a12..c2677b1 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -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$ ** ****************************************************************************/ diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index e3427ec..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$ ** ****************************************************************************/ @@ -610,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 @@ -625,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; } |