summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-08-05 03:45:19 (GMT)
committerBill King <bill.king@nokia.com>2009-08-05 03:45:19 (GMT)
commitbd51c3010e78925a2074122b281de53f01be9ef9 (patch)
tree23ac1bb378caebd0072b54fd191932ac65ac1b35 /src/gui/graphicsview/qgraphicsitem.cpp
parenta4ede01350b506c9908241f0b9002f560cc0949f (diff)
parent7e8e53cded4622ac35ff115e26e074de6722d1a0 (diff)
downloadQt-bd51c3010e78925a2074122b281de53f01be9ef9.zip
Qt-bd51c3010e78925a2074122b281de53f01be9ef9.tar.gz
Qt-bd51c3010e78925a2074122b281de53f01be9ef9.tar.bz2
Merge branch '4.5'
Conflicts: src/gui/graphicsview/qgraphicsitem.cpp
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 6a21e99..beaf42b 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -675,19 +675,22 @@ void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag ch
return;
}
- // Inherit the enabled-state from our parents.
- if ((parent && ((parent->d_ptr->ancestorFlags & flag)
- || (int(parent->d_ptr->flags & childFlag) == childFlag)
+ if (parent) {
+ // Inherit the enabled-state from our parents.
+ if ((parent->d_ptr->ancestorFlags & flag)
+ || (int(parent->d_ptr->flags & childFlag) == childFlag)
|| (childFlag == -1 && parent->d_ptr->handlesChildEvents)
- || (childFlag == -2 && parent->d_ptr->filtersDescendantEvents)))) {
- enabled = true;
- ancestorFlags |= flag;
- }
-
- // Top-level root items don't have any ancestors, so there are no
- // ancestor flags either.
- if (!parent)
+ || (childFlag == -2 && parent->d_ptr->filtersDescendantEvents)) {
+ enabled = true;
+ ancestorFlags |= flag;
+ } else {
+ ancestorFlags &= ~flag;
+ }
+ } else {
+ // Top-level root items don't have any ancestors, so there are no
+ // ancestor flags either.
ancestorFlags = 0;
+ }
} else {
// Don't set or propagate the ancestor flag if it's already correct.
if (((ancestorFlags & flag) && enabled) || (!(ancestorFlags & flag) && !enabled))