From 7a738662838763e4828c6ac8957a2823b095f566 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 17 May 2010 14:44:51 +1000 Subject: Focus should be applied to focus scopes all the way up the chain, not just to the closest focus scope parent. --- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 4 +--- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 7f71dd2..45b79a7 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -906,10 +906,8 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) if (d->focusOnPress){ QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope? while(p) { - if(p->flags() & QGraphicsItem::ItemIsFocusScope){ + if (p->flags() & QGraphicsItem::ItemIsFocusScope) p->setFocus(); - break; - } p = p->parentItem(); } setFocus(true); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index db480b1..8aa7e99 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -889,10 +889,8 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event) if(d->focusOnPress){ QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope? while(p) { - if(p->flags() & QGraphicsItem::ItemIsFocusScope){ + if (p->flags() & QGraphicsItem::ItemIsFocusScope) p->setFocus(); - break; - } p = p->parentItem(); } setFocus(true); -- cgit v0.12