From bfed75ec958bcea206ba086395f1e2fa4bbcd76f Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 27 Jan 2011 14:33:05 +0100 Subject: Cocoa: fix autotest, qgraphicsview::moveItemWhileScrolling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- cgit v0.12