summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-12-18 04:07:39 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-12-18 04:07:39 (GMT)
commita4550c49e982aa0218ab7097b814678505f8482c (patch)
tree482ae3a4c2a5fc33e06a95fe1c6aa5b39aa2f29d /src
parentd31dd9d5d9e8f647f095014523937bcfb0348121 (diff)
downloadQt-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.cpp2
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) {