diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-11-19 05:39:54 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-11-19 07:06:33 (GMT) |
commit | 244c5fbcf4556f4cfbf82500c4712abda3e77e9b (patch) | |
tree | b70eb470624b0504a32401b8bfc99390abaddffb /src/declarative/graphicsitems | |
parent | 0276466cac5a367f9337062d6d524b493e51ff0f (diff) | |
download | Qt-244c5fbcf4556f4cfbf82500c4712abda3e77e9b.zip Qt-244c5fbcf4556f4cfbf82500c4712abda3e77e9b.tar.gz Qt-244c5fbcf4556f4cfbf82500c4712abda3e77e9b.tar.bz2 |
TextEdit ignores unused key navigation
Task-number: QT-2236
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicstextedit.cpp | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicstextedit.cpp b/src/declarative/graphicsitems/qmlgraphicstextedit.cpp index a6b5ae0..2588f7d 100644 --- a/src/declarative/graphicsitems/qmlgraphicstextedit.cpp +++ b/src/declarative/graphicsitems/qmlgraphicstextedit.cpp @@ -717,28 +717,7 @@ Handles the given key \a event. void QmlGraphicsTextEdit::keyPressEvent(QKeyEvent *event) { Q_D(QmlGraphicsTextEdit); - //### this causes non-standard cursor behavior in some cases. - // is it still needed? - /*QTextCursor c = textCursor(); - QTextCursor::MoveOperation op = QTextCursor::NoMove; - if (event == QKeySequence::MoveToNextChar) { - op = QTextCursor::Right; - } else if (event == QKeySequence::MoveToPreviousChar) { - op = QTextCursor::Left; - } else if (event == QKeySequence::MoveToNextWord) { - op = QTextCursor::WordRight; - } else if (event == QKeySequence::MoveToPreviousWord) { - op = QTextCursor::WordLeft; - } else if (event == QKeySequence::MoveToNextLine) { - op = QTextCursor::Down; - } else if (event == QKeySequence::MoveToPreviousLine) { - op = QTextCursor::Up; - } - - if (op != QTextCursor::NoMove && !c.movePosition(op)) - event->ignore(); - else*/ - d->control->processEvent(event, QPointF(0, 0)); + d->control->processEvent(event, QPointF(0, 0)); if (!event->isAccepted()) QmlGraphicsPaintedItem::keyPressEvent(event); @@ -890,6 +869,7 @@ void QmlGraphicsTextEditPrivate::init() q->setFlag(QGraphicsItem::ItemAcceptsInputMethod); control = new QTextControl(q); + control->setIgnoreUnusedNavigationEvents(true); QObject::connect(control, SIGNAL(updateRequest(QRectF)), q, SLOT(updateImgCache(QRectF))); |