summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-03-03 17:39:51 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-03-04 11:32:00 (GMT)
commitbfcd2cabf7b5bc15105c968f80f71132efb65759 (patch)
treea6667e8f613a0744d768e107bb6ca7194094562e
parenta3a79fefe65ec12c4c34a69885c2d23d79538a97 (diff)
downloadQt-bfcd2cabf7b5bc15105c968f80f71132efb65759.zip
Qt-bfcd2cabf7b5bc15105c968f80f71132efb65759.tar.gz
Qt-bfcd2cabf7b5bc15105c968f80f71132efb65759.tar.bz2
Place cursor at the end of the selected range
Selected range is the range of the text that has been edited with input method, but not yet committed, normally the cursor should be placed that the end of it (or hidden). Task-number: QTBUG-17923 Reviewed-by: Morten Sørvig
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index ff2dfe7..5e8b37e 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -983,7 +983,7 @@ static int qCocoaViewCount = 0;
QString qtText;
// Cursor position is retrived from the range.
QList<QInputMethodEvent::Attribute> attrs;
- attrs<<QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, selRange.location, 1, QVariant());
+ attrs<<QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, selRange.location + selRange.length, 1, QVariant());
if ([aString isKindOfClass:[NSAttributedString class]]) {
qtText = QCFString::toQString(reinterpret_cast<CFStringRef>([aString string]));
composingLength = qtText.length();