diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-02-26 13:37:59 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-02-26 13:40:51 (GMT) |
commit | 9229489304894e35e137606ea263f007e5605d22 (patch) | |
tree | 7dc2a77ae667bddded53980ba25563bb31f02510 /tests/auto/qwidget | |
parent | f53f18d442629b859dd68ffbc2bae0ec104a9bd2 (diff) | |
download | Qt-9229489304894e35e137606ea263f007e5605d22.zip Qt-9229489304894e35e137606ea263f007e5605d22.tar.gz Qt-9229489304894e35e137606ea263f007e5605d22.tar.bz2 |
Fixed autotest tst_QWidget::translucentWidget() on Windows Vista & above
Grabbing layered windows doesn't work on Vista and above, so instead we
need to grab the corresponding area of the desktop widget.
Reviewed-by: Samuel
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index b59017b..abd9604 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -8829,7 +8829,15 @@ void tst_QWidget::translucentWidget() #endif QTest::qWait(200); - QPixmap widgetSnapshot = QPixmap::grabWindow(label.winId()); + QPixmap widgetSnapshot; + +#ifdef Q_WS_WIN + QWidget *desktopWidget = QApplication::desktop()->screen(0); + if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) + widgetSnapshot = QPixmap::grabWindow(desktopWidget->winId(), 0,0, label.width(), label.height()); + else +#endif + widgetSnapshot = QPixmap::grabWindow(label.winId()); QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32); QImage expected = pm.toImage().convertToFormat(QImage::Format_RGB32); QCOMPARE(actual.size(),expected.size()); |