diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-08-30 08:03:32 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2011-08-30 08:03:32 (GMT) |
commit | a1b2be3c8a64aee832c648c6dcdff003f22318a3 (patch) | |
tree | 4f37cb82b96ebcf119fe987f9f0ab2fcadcbad3c /src/declarative | |
parent | d6e19d1ecd9f8a26bbd2c3f38083da98c97d599e (diff) | |
download | Qt-a1b2be3c8a64aee832c648c6dcdff003f22318a3.zip Qt-a1b2be3c8a64aee832c648c6dcdff003f22318a3.tar.gz Qt-a1b2be3c8a64aee832c648c6dcdff003f22318a3.tar.bz2 |
QDeclarative::hasActiveFocus should return false for hidden items
In graphics view you can be the focus item without being visible,
but you still won't receive events. QML should hide these distinctions.
Task-number: QTBUG-21045
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeitem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index d36d163..b9d231e 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -3600,8 +3600,8 @@ void QDeclarativeItem::setSize(const QSizeF &size) bool QDeclarativeItem::hasActiveFocus() const { Q_D(const QDeclarativeItem); - return focusItem() == this || - (d->flags & QGraphicsItem::ItemIsFocusScope && focusItem() != 0); + return (focusItem() && focusItem()->isVisible()) && (focusItem() == this || + (d->flags & QGraphicsItem::ItemIsFocusScope && focusItem() != 0)); } /*! |