diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-12-07 09:50:08 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-12-07 19:10:12 +0000 |
commit | f33a1f574a354775ba9a0bb03fe376944a3a8d4c (patch) | |
tree | a9ff830b99ec0f5eaed567a0a90870ee9dee2de4 /tests/auto/widgets/graphicsview/qgraphicsproxywidget | |
parent | a31f65d8c88d5973645ddbeb03ab3286428e5ec4 (diff) |
Port away from QRegion::rects()
Use being()/end() instead.
These were the last remaining uses of QRegion::rects() within qtbase.
Change-Id: I264beb6f660968f40eecbbee2260341fca94ddb5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsproxywidget')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 1529cfc158..8287b9ebdd 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1471,6 +1471,15 @@ protected: } }; +// ### work around missing QVector ctor from iterator pair: +static QVector<QRect> rects(const QRegion ®ion) +{ + QVector<QRect> result; + for (QRect r : region) + result.push_back(r); + return result; +} + void tst_QGraphicsProxyWidget::scrollUpdate() { ScrollWidget *widget = new ScrollWidget; @@ -1492,10 +1501,10 @@ void tst_QGraphicsProxyWidget::scrollUpdate() // QRect(0, 0, 200, 12) is the first update, expanded (-2, -2, 2, 2) // QRect(0, 12, 102, 10) is the scroll update, expanded (-2, -2, 2, 2), // intersected with the above update. - QCOMPARE(view.paintEventRegion.rects(), + QCOMPARE(rects(view.paintEventRegion), QVector<QRect>() << QRect(0, 0, 200, 12) << QRect(0, 12, 102, 10)); QCOMPARE(widget->npaints, 2); - QCOMPARE(widget->paintEventRegion.rects(), + QCOMPARE(rects(widget->paintEventRegion), QVector<QRect>() << QRect(0, 0, 200, 12) << QRect(0, 12, 102, 10)); } |