summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-05 12:11:03 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-06 11:19:26 (GMT)
commitf8a0b7b9ea2e077be7167c58d4eac27360d4cee6 (patch)
tree8da241b063829cdd910277ebe0ed22032c2819c4 /src/gui/graphicsview/qgraphicsitem.cpp
parent3433bc44168398734cdd53df9b64adf016c8ab3b (diff)
downloadQt-f8a0b7b9ea2e077be7167c58d4eac27360d4cee6.zip
Qt-f8a0b7b9ea2e077be7167c58d4eac27360d4cee6.tar.gz
Qt-f8a0b7b9ea2e077be7167c58d4eac27360d4cee6.tar.bz2
QGraphicsView: Fixes QGraphicsView::focusItem when scene is not active
When scene is not active, returns the item that would get the focus if the scene became active. This is more consistant with Qt 4.5 behaviour Reviewed-by: Andreas
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 949f555..073c31b 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2980,7 +2980,7 @@ bool QGraphicsItem::hasFocus() const
{
if (d_ptr->focusProxy)
return d_ptr->focusProxy->hasFocus();
- return (d_ptr->scene && d_ptr->scene->focusItem() == this);
+ return isActive() && (d_ptr->scene && d_ptr->scene->focusItem() == this);
}
/*!