summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsview
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-01-27 13:33:05 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-01-27 13:33:05 (GMT)
commitbfed75ec958bcea206ba086395f1e2fa4bbcd76f (patch)
tree2ac51e3c4e50601c5ccb812618ab36931177fe8b /tests/auto/qgraphicsview
parentd4e85d7da4d3d1db8a9abf8e1c2303c69441e8ef (diff)
downloadQt-bfed75ec958bcea206ba086395f1e2fa4bbcd76f.zip
Qt-bfed75ec958bcea206ba086395f1e2fa4bbcd76f.tar.gz
Qt-bfed75ec958bcea206ba086395f1e2fa4bbcd76f.tar.bz2
Cocoa: fix autotest, qgraphicsview::moveItemWhileScrolling
This test reveals a real bug when updating and scrolling at the same time in graphicsview. The problem is that the scroll will issue an update to cocoa that gets handled before already queued Qt events. This means that the viewport of graphicsview will receive a paintevent, and clear dirtyScrollOffset, before the posted call to _q_processDirtyItems is executed. This means that we 'loose' the scrolling information upon painting. I discussed this problem with Bjørn Erik, and he had strong opinions about this promblem not worthwhile fixing. The raster engine is anyway about to be default on Mac, and there the problem will not exist.
Diffstat (limited to 'tests/auto/qgraphicsview')
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index cf697bb..aaff51e 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -3357,6 +3357,10 @@ void tst_QGraphicsView::moveItemWhileScrolling()
int a = adjustForAntialiasing ? 2 : 1;
expectedRegion += QRect(40, 50, 10, 10).adjusted(-a, -a, a, a);
expectedRegion += QRect(40, 60, 10, 10).adjusted(-a, -a, a, a);
+#ifdef QT_MAC_USE_COCOA
+ if (QApplicationPrivate::graphicsSystem() == 0)
+ QEXPECT_FAIL("", "This will fail with Cocoa because paint events are not send in the order expected by graphicsview", Continue);
+#endif
COMPARE_REGIONS(view.lastPaintedRegion, expectedRegion);
}