summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene_p.h
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-04-02 12:48:13 (GMT)
committerBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-04-07 13:51:09 (GMT)
commit37c72476fc444d3089075473cb4e9aa42ed64694 (patch)
tree9be965f35f51da8bcd9a5347388b7cfd0e08b520 /src/gui/graphicsview/qgraphicsscene_p.h
parenta10b39a1884c97e62fbe599358ea6a8fb900c528 (diff)
downloadQt-37c72476fc444d3089075473cb4e9aa42ed64694.zip
Qt-37c72476fc444d3089075473cb4e9aa42ed64694.tar.gz
Qt-37c72476fc444d3089075473cb4e9aa42ed64694.tar.bz2
Disable mouse tracking in QGraphicsView if possible.
We don't need mouse tracking unless there are items in the scene that either accept hover events or have a cursor set. This cut-off is extremely efficient in the common case since all items ignore hover events and use the standard cursor by default. We no longer dig for items and do lots of intersection and calculating just for fun :-) We even get rid of the overhead of 2 x QCoreApplication::sendEvent! The next step is to optimize the items(*) functions to simply check for hasCursor()/acceptsHoverEvents() before we do complex checks like intersects/collidesWithPath() etc. Auto test included. Reviewed-by: Andreas
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index 8af8b28..9ace725 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -168,6 +168,9 @@ public:
Qt::DropAction lastDropAction;
QList<QGraphicsItem *> cachedItemsUnderMouse;
QList<QGraphicsItem *> hoverItems;
+ bool allItemsIgnoreHoverEvents;
+ bool allItemsUseDefaultCursor;
+ void enableMouseTrackingOnViews();
QMap<Qt::MouseButton, QPointF> mouseGrabberButtonDownPos;
QMap<Qt::MouseButton, QPointF> mouseGrabberButtonDownScenePos;
QMap<Qt::MouseButton, QPoint> mouseGrabberButtonDownScreenPos;