summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/painting')
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp
index 93d2baf332..dc694e1107 100644
--- a/tests/auto/gui/painting/qregion/tst_qregion.cpp
+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp
@@ -35,6 +35,10 @@
#include <qpainterpath.h>
#include <qpolygon.h>
+#ifdef Q_OS_WIN
+# include <qt_windows.h>
+#endif
+
class tst_QRegion : public QObject
{
Q_OBJECT
@@ -86,6 +90,10 @@ private slots:
void regionToPath_data();
void regionToPath();
#endif
+
+#ifdef Q_OS_WIN
+ void winConversion();
+#endif
};
tst_QRegion::tst_QRegion()
@@ -1061,7 +1069,21 @@ void tst_QRegion::regionToPath()
QCOMPARE(a.boundingRect(), b.boundingRect());
}
}
-#endif
+#endif // QT_BUILD_INTERNAL
+
+#ifdef Q_OS_WIN
+void tst_QRegion::winConversion()
+{
+ const QList<QRect> rects{QRect(10, 10, 10, 10), QRect(10, 20, 10, 10),
+ QRect(30, 20, 10, 10), QRect(10, 30, 10, 10)};
+ QRegion region;
+ region.setRects(rects.constData(), rects.size());
+ auto hrgn = region.toHRGN();
+ QVERIFY(hrgn);
+ QRegion convertedBack = QRegion::fromHRGN(hrgn);
+ QCOMPARE(region, convertedBack);
+}
+#endif // Q_OS_WIN
QTEST_MAIN(tst_QRegion)
#include "tst_qregion.moc"