summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene_p.h
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-10 15:08:15 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-10 15:08:15 (GMT)
commitd8f65a7f0707d8a97801ad20d690672e0124b491 (patch)
tree0c881ac70d9063044ca1ca09290d0747bf322693 /src/gui/graphicsview/qgraphicsscene_p.h
parent9683cf068c3f933f836dc2a5b4a19b1c2f86d38a (diff)
parent747444c6776d948dad479e7b6f3564d0515d4e52 (diff)
downloadQt-d8f65a7f0707d8a97801ad20d690672e0124b491.zip
Qt-d8f65a7f0707d8a97801ad20d690672e0124b491.tar.gz
Qt-d8f65a7f0707d8a97801ad20d690672e0124b491.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: src/gui/graphicsview/qgraphicsitem.cpp src/gui/graphicsview/qgraphicsitem_p.h src/gui/graphicsview/qgraphicsscene_p.h
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h45
1 files changed, 35 insertions, 10 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index f90bb8f..bd312a1 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -58,6 +58,7 @@
#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
#include "qgraphicssceneevent.h"
+#include "qgraphicsview.h"
#include "qgraphicsscene_bsp_p.h"
#include "qgraphicsitem_p.h"
@@ -69,6 +70,9 @@
#include <QtGui/qfont.h>
#include <QtGui/qpalette.h>
#include <QtGui/qstyle.h>
+#include <QtGui/qstyleoption.h>
+
+static const int QGRAPHICSSCENE_INDEXTIMER_TIMEOUT = 2000;
QT_BEGIN_NAMESPACE
@@ -106,31 +110,30 @@ public:
QList<QRectF> updatedRects;
bool updateAll;
bool calledEmitUpdated;
+ bool processDirtyItemsEmitted;
QPainterPath selectionArea;
int selectionChanging;
QSet<QGraphicsItem *> selectedItems;
QList<QGraphicsItem *> unindexedItems;
QList<QGraphicsItem *> indexedItems;
- QList<QGraphicsItem *> dirtyItems;
QList<QGraphicsItem *> pendingUpdateItems;
QList<QGraphicsItem *> unpolishedItems;
QList<QGraphicsItem *> topLevelItems;
+ bool needSortTopLevelItems;
QMap<QGraphicsItem *, QPointF> movingItemsInitialPositions;
void registerTopLevelItem(QGraphicsItem *item);
void unregisterTopLevelItem(QGraphicsItem *item);
void _q_updateLater();
void _q_polishItems();
- void _q_resetDirtyItems();
- void resetDirtyItemsLater();
- bool dirtyItemResetPending;
+ void _q_processDirtyItems();
QList<int> freeItemIndexes;
bool regenerateIndex;
bool purgePending;
- void _q_removeItemLater(QGraphicsItem *item);
+ void removeItemHelper(QGraphicsItem *item);
QSet<QGraphicsItem *> removedItems;
void purgeRemovedItems();
@@ -139,7 +142,7 @@ public:
int indexTimerId;
bool restartIndexTimer;
- void startIndexTimer();
+ void startIndexTimer(int interval = QGRAPHICSSCENE_INDEXTIMER_TIMEOUT);
bool stickyFocus;
bool hasFocus;
@@ -208,6 +211,10 @@ public:
void mousePressEventHandler(QGraphicsSceneMouseEvent *mouseEvent);
QGraphicsWidget *windowForItem(const QGraphicsItem *item) const;
+ void recursive_items_helper(QGraphicsItem *item, QRectF rect, QList<QGraphicsItem *> *items,
+ const QTransform &parentTransform, const QTransform &viewTransform,
+ Qt::ItemSelectionMode mode, Qt::SortOrder order, qreal parentOpacity = 1.0) const;
+
QList<QGraphicsItem *> items_helper(const QPointF &pos) const;
QList<QGraphicsItem *> items_helper(const QRectF &rect,
Qt::ItemSelectionMode mode,
@@ -257,6 +264,26 @@ public:
void drawItemHelper(QGraphicsItem *item, QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget,
bool painterStateProtection);
+
+ void drawSubtreeRecursive(QGraphicsItem *item, QPainter *painter, const QTransform &viewTransform,
+ QRegion *exposedRegion, QWidget *widget,
+ QList<QGraphicsItem *> *topLevelItems = 0, qreal parentOpacity = qreal(1.0));
+ void markDirty(QGraphicsItem *item, const QRectF &rect = QRectF(), bool invalidateChildren = false,
+ bool maybeDirtyClipPath = false, bool force = false, bool ignoreOpacity = false,
+ bool removingItemFromScene = false);
+ void processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren = false);
+
+ inline void resetDirtyItem(QGraphicsItem *item)
+ {
+ Q_ASSERT(item);
+ item->d_ptr->dirty = 0;
+ item->d_ptr->paintedViewBoundingRectsNeedRepaint = 0;
+ item->d_ptr->geometryChanged = 0;
+ item->d_ptr->dirtyChildren = 0;
+ item->d_ptr->needsRepaint = QRectF();
+ item->d_ptr->allChildrenDirty = 0;
+ item->d_ptr->fullUpdatePending = 0;
+ }
QStyle *style;
QFont font;
@@ -268,6 +295,8 @@ public:
void resolvePalette();
void updatePalette(const QPalette &palette);
+ QStyleOptionGraphicsItem styleOptionTmp;
+
// items with gestures -> list of started gestures.
QMap<QGraphicsItem*, QSet<QGesture*> > itemsWithGestures;
QSet<int> grabbedGestures;
@@ -275,10 +304,6 @@ public:
void releaseGesture(QGraphicsItem *item, int gestureId);
void sendGestureEvent(const QSet<QGesture*> &gestures, const QSet<QString> &cancelled);
- mutable QVector<QTransform> sceneTransformCache;
- mutable QBitArray validTransforms;
- mutable QVector<int> freeSceneTransformSlots;
-
QMap<int, QGraphicsSceneTouchEvent::TouchPoint> sceneCurrentTouchPoints;
QHash<int, QGraphicsItem *> itemForTouchPointId;
static void updateTouchPointsForItem(QGraphicsItem *item, QGraphicsSceneTouchEvent *touchEvent);