diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-05-13 14:42:48 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-05-13 14:42:48 (GMT) |
commit | b3cf8db56491642443f4eea86a12e3d0eb869217 (patch) | |
tree | 1ba2ff457fc790fb57b786accc7c278de5362f5b /src/declarative/graphicsitems/qdeclarativetextedit.cpp | |
parent | 29559bb440529e4afd766cad61578947e86fa948 (diff) | |
parent | 1fdcceb52bf0b9a3f34c705eb233ac251fbb251a (diff) | |
download | Qt-b3cf8db56491642443f4eea86a12e3d0eb869217.zip Qt-b3cf8db56491642443f4eea86a12e3d0eb869217.tar.gz Qt-b3cf8db56491642443f4eea86a12e3d0eb869217.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextedit.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextedit.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 6d86e58..db20da8 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -899,6 +899,7 @@ Handles the given mouse \a event. void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_D(QDeclarativeTextEdit); + bool hadFocus = hasFocus(); if (d->focusOnPress){ QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope? while(p) { @@ -910,6 +911,8 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) } setFocus(true); } + if (!hadFocus && hasFocus()) + d->clickCausedFocus = true; d->control->processEvent(event, QPointF(0, 0)); if (!event->isAccepted()) QDeclarativePaintedItem::mousePressEvent(event); @@ -924,11 +927,12 @@ void QDeclarativeTextEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_D(QDeclarativeTextEdit); QWidget *widget = event->widget(); if (widget && (d->control->textInteractionFlags() & Qt::TextEditable) && boundingRect().contains(event->pos())) - qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), d->focusOnPress); + qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus); + d->clickCausedFocus = false; d->control->processEvent(event, QPointF(0, 0)); if (!event->isAccepted()) - QDeclarativePaintedItem::mousePressEvent(event); + QDeclarativePaintedItem::mouseReleaseEvent(event); } /*! @@ -952,7 +956,8 @@ void QDeclarativeTextEdit::mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_D(QDeclarativeTextEdit); d->control->processEvent(event, QPointF(0, 0)); if (!event->isAccepted()) - QDeclarativePaintedItem::mousePressEvent(event); + QDeclarativePaintedItem::mouseMoveEvent(event); + event->setAccepted(true); } /*! |