summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp8
2 files changed, 2 insertions, 14 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 3b4f2a7..3106daf 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1113,13 +1113,7 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
Q_D(QDeclarativeTextEdit);
if (d->focusOnPress){
bool hadFocus = hasFocus();
- QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope?
- while(p) {
- if (p->flags() & QGraphicsItem::ItemIsFocusScope)
- p->setFocus();
- p = p->parentItem();
- }
- setFocus(true);
+ forceFocus();
if (d->showInputPanelOnFocus) {
if (hasFocus() && hadFocus && !isReadOnly()) {
// re-open input panel on press if already focused
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 633c01e..cba01ef 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -924,13 +924,7 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
Q_D(QDeclarativeTextInput);
if(d->focusOnPress){
bool hadFocus = hasFocus();
- QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope?
- while(p) {
- if (p->flags() & QGraphicsItem::ItemIsFocusScope)
- p->setFocus();
- p = p->parentItem();
- }
- setFocus(true);
+ forceFocus();
if (d->showInputPanelOnFocus) {
if (hasFocus() && hadFocus && !isReadOnly()) {
// re-open input panel on press if already focused