summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicstextedit.cpp')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstextedit.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicstextedit.cpp b/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
index 6e14d3a..c3495b3 100644
--- a/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
@@ -784,8 +784,17 @@ Handles the given mouse \a event.
void QmlGraphicsTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QmlGraphicsTextEdit);
- if (d->focusOnPress)
+ if (d->focusOnPress){
+ QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope?
+ while(p) {
+ if(p->flags() & QGraphicsItem::ItemIsFocusScope){
+ p->setFocus();
+ break;
+ }
+ p = p->parentItem();
+ }
setFocus(true);
+ }
d->control->processEvent(event, QPointF(0, 0));
if (!event->isAccepted())
QmlGraphicsPaintedItem::mousePressEvent(event);