diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-01-14 10:43:05 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-01-21 15:23:58 (GMT) |
commit | dc3005761d332f86d59257e2c6bb8aac70222b18 (patch) | |
tree | 84d06e0620086cde96530e5979ba75873d464619 /src/gui/graphicsview/qgraphicsscene.cpp | |
parent | 474e0dce59e827e4dd502bf12e7817b2602fb2c3 (diff) | |
download | Qt-dc3005761d332f86d59257e2c6bb8aac70222b18.zip Qt-dc3005761d332f86d59257e2c6bb8aac70222b18.tar.gz Qt-dc3005761d332f86d59257e2c6bb8aac70222b18.tar.bz2 |
Optimize QGraphicsScenePrivate::itemAcceptsHoverEvents_helper
Make sure we do cheap tests before the more expensive ones.
This function is called from QGraphicsScene::addItem.
Task-number: QTBUG-6877
Reviewed-by: alexis
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 49925e1..fa9f794 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -3767,10 +3767,10 @@ void QGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent) bool QGraphicsScenePrivate::itemAcceptsHoverEvents_helper(const QGraphicsItem *item) const { - return (!item->isBlockedByModalPanel() && - (item->acceptHoverEvents() - || (item->isWidget() - && static_cast<const QGraphicsWidget *>(item)->d_func()->hasDecoration()))); + return (item->d_ptr->acceptsHover + || (item->d_ptr->isWidget + && static_cast<const QGraphicsWidget *>(item)->d_func()->hasDecoration())) + && !item->isBlockedByModalPanel(); } /*! |