diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-13 09:05:24 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-13 09:05:48 (GMT) |
commit | dee871b4375c2625217448f2b15e4518b7f9d993 (patch) | |
tree | 62a1fd5e271dbf0b9359d4f7fbad006541a88cef /tests/auto/qgraphicsview/tst_qgraphicsview.cpp | |
parent | 9c6e466dc09813dd4a641b2cf385f35ac99346f5 (diff) | |
parent | 6a1be803bf94b8af4a4766e31df9b441d1c81eed (diff) | |
download | Qt-dee871b4375c2625217448f2b15e4518b7f9d993.zip Qt-dee871b4375c2625217448f2b15e4518b7f9d993.tar.gz Qt-dee871b4375c2625217448f2b15e4518b7f9d993.tar.bz2 |
Merge qt-team-widgets/4.6 into origin/4.6
Diffstat (limited to 'tests/auto/qgraphicsview/tst_qgraphicsview.cpp')
-rw-r--r-- | tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index df3ebef..8acaa72 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -84,6 +84,12 @@ Q_DECLARE_METATYPE(QPolygonF) Q_DECLARE_METATYPE(QRectF) Q_DECLARE_METATYPE(Qt::ScrollBarPolicy) +#ifdef Q_WS_MAC +//On mac we get full update. So check that the expected region is contained inside the actual +#define COMPARE_REGIONS(ACTUAL, EXPECTED) QVERIFY((EXPECTED).subtracted(ACTUAL).isEmpty()) +#else +#define COMPARE_REGIONS QCOMPARE +#endif static void sendMousePress(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::LeftButton) { @@ -115,6 +121,7 @@ public: } int count() const { return _count; } + void reset() { _count = 0; } protected: bool eventFilter(QObject *watched, QEvent *event) @@ -2938,10 +2945,11 @@ void tst_QGraphicsView::task239729_noViewUpdate() view->show(); QTest::qWaitForWindowShown(view); - QTRY_COMPARE(spy.count(), 1); + QTRY_VERIFY(spy.count() >= 1); + spy.reset(); scene.update(); QApplication::processEvents(); - QTRY_COMPARE(spy.count(), 2); + QTRY_COMPARE(spy.count(), 1); delete view; } @@ -3177,7 +3185,7 @@ 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); - QCOMPARE(view.lastPaintedRegion, expectedRegion); + COMPARE_REGIONS(view.lastPaintedRegion, expectedRegion); } void tst_QGraphicsView::centerOnDirtyItem() |