diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-08-06 03:39:10 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-08-06 03:42:48 (GMT) |
commit | 94b1c07c31ab84d30b198cb23291a48f98164827 (patch) | |
tree | fbbf540dfdf6772d9702bf53e2a22964db103530 /src | |
parent | 97f64280e37f29bdeb92d6de55fac56b1ff37084 (diff) | |
download | Qt-94b1c07c31ab84d30b198cb23291a48f98164827.zip Qt-94b1c07c31ab84d30b198cb23291a48f98164827.tar.gz Qt-94b1c07c31ab84d30b198cb23291a48f98164827.tar.bz2 |
Top-level QML item should not have special focus handling.
It's the scene itself that acts as a focus scope, not the top-level
item.
Task-number: QTBUG-12682
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeitem.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 5b74129..ff05997 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -3196,8 +3196,7 @@ bool QDeclarativeItem::hasActiveFocus() const { Q_D(const QDeclarativeItem); return focusItem() == this || - (d->flags & QGraphicsItem::ItemIsFocusScope && focusItem() != 0) || - (!parentItem() && focusItem() != 0); + (d->flags & QGraphicsItem::ItemIsFocusScope && focusItem() != 0); } /*! @@ -3217,10 +3216,8 @@ bool QDeclarativeItem::hasActiveFocus() const } \endqml - For the purposes of this property, the top level item in the scene - is assumed to act like a focus scope, and to always have active focus - when the scene has focus. On a practical level, that means the following - QML will give active focus to \c input on startup. + For the purposes of this property, the scene as a whole is assumed to act like a focus scope. + On a practical level, that means the following QML will give active focus to \c input on startup. \qml Rectangle { @@ -3246,7 +3243,7 @@ bool QDeclarativeItem::hasFocus() const p = p->parentItem(); } - return hasActiveFocus() ? true : (!QGraphicsItem::parentItem() ? true : false); + return hasActiveFocus(); } /*! \internal */ |