diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-10-22 13:07:11 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-10-22 13:07:11 +0200 |
commit | b103f6a6b9cc0ddf3df2788816a6fd98369b1b6d (patch) | |
tree | fc90bc070f0f50a2d8768db8fa1e16611d158f18 /tests/auto/quick/qquickwindow | |
parent | 4867a49618e0d6a476e0549aeca5134b2e3c5892 (diff) | |
parent | 8ee3673e439b4499a8a4a4280637ee0270c4a54a (diff) |
Merge remote-tracking branch 'origin/5.6' into origin/dev
Conflicts:
src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp
src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h
src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
src/qml/debugger/qqmldebugserviceinterfaces.cpp
src/qml/jsruntime/qv4debugging_p.h
Change-Id: I82a4ce1bcd4579181df886558f55ad2b328d1682
Diffstat (limited to 'tests/auto/quick/qquickwindow')
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 0ac15c28ce..b16b7b3686 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -277,6 +277,10 @@ class tst_qquickwindow : public QQmlDataTest { Q_OBJECT public: + tst_qquickwindow() + { + QQuickWindow::setDefaultAlphaBuffer(true); + } private slots: void initTestCase() @@ -1081,17 +1085,25 @@ void tst_qquickwindow::defaultState() void tst_qquickwindow::grab_data() { QTest::addColumn<bool>("visible"); - QTest::newRow("visible") << true; - QTest::newRow("invisible") << false; + QTest::addColumn<bool>("alpha"); + QTest::newRow("visible,opaque") << true << false; + QTest::newRow("invisible,opaque") << false << false; + QTest::newRow("visible,transparent") << true << true; + QTest::newRow("invisible,transparent") << false << true; } void tst_qquickwindow::grab() { QFETCH(bool, visible); + QFETCH(bool, alpha); QQuickWindow window; window.setTitle(QLatin1String(QTest::currentTestFunction()) + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag())); - window.setColor(Qt::red); + if (alpha) { + window.setColor(QColor(0, 0, 0, 0)); + } else { + window.setColor(Qt::red); + } window.resize(250, 250); @@ -1103,9 +1115,14 @@ void tst_qquickwindow::grab() } QImage content = window.grabWindow(); - QCOMPARE(content.width(), window.width()); - QCOMPARE(content.height(), window.height()); - QCOMPARE((uint) content.convertToFormat(QImage::Format_RGB32).pixel(0, 0), (uint) 0xffff0000); + QCOMPARE(content.width(), int(window.width() * window.devicePixelRatio())); + QCOMPARE(content.height(), int(window.height() * window.devicePixelRatio())); + + if (alpha) { + QCOMPARE((uint) content.convertToFormat(QImage::Format_ARGB32_Premultiplied).pixel(0, 0), (uint) 0x00000000); + } else { + QCOMPARE((uint) content.convertToFormat(QImage::Format_RGB32).pixel(0, 0), (uint) 0xffff0000); + } } void tst_qquickwindow::multipleWindows() |