diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-08-02 22:49:38 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-08-02 22:52:32 +0200 |
commit | ee07b912a1768ea0b103544f9eeac41f3cf50cf6 (patch) | |
tree | 15bfa7e4a9c098511c1fc89e2b2c240520b85e2d /tests/auto/widgets/styles | |
parent | 4bfff6a98b59b32605d881a463ad3edc221a7dc8 (diff) | |
parent | a96656a8fb6a3c1fc7765659efff28f807fd0deb (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
src/plugins/platforms/xcb/qxcbconnection.h
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
src/plugins/styles/mac/qmacstyle_mac.mm
src/widgets/widgets/qdockarealayout.cpp
src/widgets/widgets/qmainwindow.cpp
src/widgets/widgets/qmainwindowlayout.cpp
src/widgets/widgets/qmainwindowlayout_p.h
tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
tests/auto/other/macnativeevents/BLACKLIST
tests/auto/widgets/widgets/qmenu/BLACKLIST
Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
Diffstat (limited to 'tests/auto/widgets/styles')
-rw-r--r-- | tests/auto/widgets/styles/qstyle/task_25863.png | bin | 910 -> 0 bytes | |||
-rw-r--r-- | tests/auto/widgets/styles/qstyle/testdata.qrc | 1 | ||||
-rw-r--r-- | tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 15 |
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/widgets/styles/qstyle/task_25863.png b/tests/auto/widgets/styles/qstyle/task_25863.png Binary files differdeleted file mode 100644 index a2de8d6f78..0000000000 --- a/tests/auto/widgets/styles/qstyle/task_25863.png +++ /dev/null diff --git a/tests/auto/widgets/styles/qstyle/testdata.qrc b/tests/auto/widgets/styles/qstyle/testdata.qrc index c16b9be775..29bb46726e 100644 --- a/tests/auto/widgets/styles/qstyle/testdata.qrc +++ b/tests/auto/widgets/styles/qstyle/testdata.qrc @@ -15,6 +15,5 @@ <file>images/vista/radiobutton.png</file> <file>images/vista/slider.png</file> <file>images/vista/spinbox.png</file> - <file>task_25863.png</file> </qresource> </RCC> diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index 3607f1ba92..d5ef2fe94b 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -58,6 +58,8 @@ #include <qscrollarea.h> #include <qwidget.h> +#include <algorithm> + // Make a widget frameless to prevent size constraints of title bars // from interfering (Windows). static inline void setFrameless(QWidget *w) @@ -197,13 +199,12 @@ void tst_QStyle::drawItemPixmap() testWidget->resize(300, 300); testWidget->showNormal(); - const QString imageFileName = QFINDTESTDATA("task_25863.png"); - QVERIFY(!imageFileName.isEmpty()); - - QPixmap p(imageFileName, "PNG"); - const QPixmap actualPix = testWidget->grab(); - - QCOMPARE(actualPix, p); + QImage image = testWidget->grab().toImage(); + const QRgb green = QColor(Qt::green).rgb(); + QVERIFY(image.reinterpretAsFormat(QImage::Format_RGB32)); + const QRgb *bits = reinterpret_cast<const QRgb *>(image.constBits()); + const QRgb *end = bits + image.byteCount() / sizeof(QRgb); + QVERIFY(std::all_of(bits, end, [green] (QRgb r) { return r == green; })); testWidget->hide(); } |