diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-12-18 04:07:39 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-12-18 04:07:39 (GMT) |
commit | a4550c49e982aa0218ab7097b814678505f8482c (patch) | |
tree | 482ae3a4c2a5fc33e06a95fe1c6aa5b39aa2f29d /src | |
parent | d31dd9d5d9e8f647f095014523937bcfb0348121 (diff) | |
download | Qt-a4550c49e982aa0218ab7097b814678505f8482c.zip Qt-a4550c49e982aa0218ab7097b814678505f8482c.tar.gz Qt-a4550c49e982aa0218ab7097b814678505f8482c.tar.bz2 |
Check if the scene exists before attempting to set its focus item.
Prevents crashing when an item involved in the scope chain is set to
be visible but it isn't part of a scene.
Reviewed-by: Alexis Menard
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 90cc132..03e8b09 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2181,7 +2181,7 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo } // Enable subfocus - if (newVisible) { + if (scene && newVisible) { QGraphicsItem *p = parent; bool done = false; while (p) { |