diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-13 13:55:44 +0200 |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-13 14:03:06 +0200 |
commit | d9d76d0f56b0e2b0ce09abf39c710a1e666fa09f (patch) | |
tree | dd1a68c3a7054c06afe1807f199efbb0ca5fa05f /tests/auto/qgraphicsview | |
parent | 1f8fae877a8f4fcaec77c7d2dc1376b7ade61aee (diff) | |
download | qt4-tools-d9d76d0f56b0e2b0ce09abf39c710a1e666fa09f.tar.gz |
Fix graphicsview test on Cocoa.
Cocoa doesn't support regions update and always update the
bounding rect (see comment in QWidgetPrivate::update_sys
in qwidget_mac.cpp)
Change tests that checked that we get the exact regions.
Reviewed-by: MortenS
Diffstat (limited to 'tests/auto/qgraphicsview')
-rw-r--r-- | tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 8acaa72eb5..389200b9aa 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -2210,9 +2210,11 @@ void tst_QGraphicsView::viewportUpdateMode() // The view gets two updates for the update scene updates. QTRY_VERIFY(!view.lastUpdateRegions.isEmpty()); +#ifndef QT_MAC_USE_COCOA //cocoa doesn't support drawing regions QCOMPARE(view.lastUpdateRegions.last().rects().size(), 2); QCOMPARE(view.lastUpdateRegions.last().rects().at(0).size(), QSize(15, 15)); QCOMPARE(view.lastUpdateRegions.last().rects().at(1).size(), QSize(15, 15)); +#endif // Set full update mode. view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); @@ -3431,10 +3433,12 @@ void tst_QGraphicsView::exposeRegion() // Make sure it triggers correct repaint on the view. QTRY_COMPARE(view.lastUpdateRegions.size(), 1); - QTRY_COMPARE(view.lastUpdateRegions.at(0), expectedExposeRegion); + COMPARE_REGIONS(view.lastUpdateRegions.at(0), expectedExposeRegion); // Make sure the item didn't get any repaints. +#ifndef QT_MAC_USE_COCOA QCOMPARE(item->paints, 0); +#endif } void tst_QGraphicsView::update_data() |