summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-29 12:34:31 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-29 12:34:31 +0100
commita224dfc9d19757734bf49fcefdeaad5d855dfe98 (patch)
tree83b61bea7fa243557febe9652f3f16d265a2689a /tests/auto/widgets/kernel
parentbe84480785b9686dc09937fa33b685de7cc570f1 (diff)
parentf253f4c3310655933266f62e90f46fd12b5c49e4 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: tests/auto/corelib/io/qprocess/tst_qprocess.cpp Change-Id: Ib6955eb874b516b185b45d6c38cec646fbaa95f4
Diffstat (limited to 'tests/auto/widgets/kernel')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index afee548c9b..515ddf480f 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -4974,7 +4974,9 @@ static inline QByteArray msgRgbMismatch(unsigned actual, unsigned expected)
static QPixmap grabWindow(QWindow *window, int x, int y, int width, int height)
{
QScreen *screen = window->screen();
- return screen ? screen->grabWindow(window->winId(), x, y, width, height) : QPixmap();
+ Q_ASSERT(screen);
+ QPixmap result = screen->grabWindow(window->winId(), x, y, width, height);
+ return result.devicePixelRatio() > 1 ? result.scaled(width, height) : result;
}
#define VERIFY_COLOR(child, region, color) verifyColor(child, region, color, __LINE__)
@@ -8500,7 +8502,7 @@ void tst_QWidget::translucentWidget()
#ifdef Q_OS_WIN
QWidget *desktopWidget = QApplication::desktop()->screen(0);
if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
- widgetSnapshot = qApp->primaryScreen()->grabWindow(desktopWidget->winId(), labelPos.x(), labelPos.y(), label.width(), label.height());
+ widgetSnapshot = grabWindow(desktopWidget->windowHandle(), labelPos.x(), labelPos.y(), label.width(), label.height());
else
#endif
widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));