summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-06-15 05:49:08 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-06-15 05:49:08 (GMT)
commitc1e6d97b9476c859abc3927046144b4006fcf735 (patch)
treeb7eb906c850ff2c06ffb96f74d0f8d2b0feb55ae /src/declarative/graphicsitems
parentb18a343cc63f93a8e97a8c6c623e56a666775b57 (diff)
downloadQt-c1e6d97b9476c859abc3927046144b4006fcf735.zip
Qt-c1e6d97b9476c859abc3927046144b4006fcf735.tar.gz
Qt-c1e6d97b9476c859abc3927046144b4006fcf735.tar.bz2
Remove duplicated code.
Diffstat (limited to 'src/declarative/graphicsitems')
-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