diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-09-05 22:17:34 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-07 08:27:50 +0200 |
commit | 5dd2713c8ba98e06ae5c4f3da44b2ed73121d247 (patch) | |
tree | dceb7ee541c260efbe50546c019ffb172919b8c5 /src/widgets/graphicsview/qgraphicsitem.cpp | |
parent | 23d7f6ee5dea3dd9f47f4ab538b25dc0ffe3df92 (diff) |
Fix constant false comparison of out-of-range enums
QGraphicsItem::GraphicsItemFlag is unsigned, so a comparison to -1
is always false.
qgraphicsitem.cpp:847:39: error: comparison of constant -1 with expression of type 'QGraphicsItem::GraphicsItemFlag' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
Change-Id: I3fc59b777d09060dd34e81f51ed8bdf41354a0f1
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index bb6033ba6c..47c05d4a46 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -844,8 +844,8 @@ void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag ch // 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)) { + || (int(childFlag) == -1 && parent->d_ptr->handlesChildEvents) + || (int(childFlag) == -2 && parent->d_ptr->filtersDescendantEvents)) { enabled = true; ancestorFlags |= flag; } else { @@ -868,7 +868,7 @@ void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag ch ancestorFlags &= ~flag; // Don't process children if the item has the main flag set on itself. - if ((childFlag != -1 && int(flags & childFlag) == childFlag) + if ((int(childFlag) != -1 && int(flags & childFlag) == childFlag) || (int(childFlag) == -1 && handlesChildEvents) || (int(childFlag) == -2 && filtersDescendantEvents)) return; |