diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-14 17:46:16 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-14 17:46:34 +0200 |
commit | 440286655e0ca271506cf7cc02ad0dbf4baef9ca (patch) | |
tree | 896fa81adb8b14a69355a3a6cf64d06ec8173c9a /tests/auto/widgets/kernel | |
parent | 1e27ad1697187549151657ba187928e439300db7 (diff) | |
parent | e164d61ca8263fc4b46fdd916e1ea77c7dd2b735 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
Diffstat (limited to 'tests/auto/widgets/kernel')
-rw-r--r-- | tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp | 10 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 14 |
2 files changed, 16 insertions, 8 deletions
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp index 8c262ff3a5..84120c70e9 100644 --- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp @@ -115,6 +115,7 @@ private slots: void context(); void duplicatedShortcutOverride(); void shortcutToFocusProxy(); + void deleteLater(); protected: static Qt::KeyboardModifiers toButtons( int key ); @@ -1263,5 +1264,14 @@ void tst_QShortcut::shortcutToFocusProxy() QCOMPARE(le.text(), QString()); } +void tst_QShortcut::deleteLater() +{ + QWidget w; + QPointer<QShortcut> sc(new QShortcut(QKeySequence(Qt::Key_1), &w)); + sc->deleteLater(); + QTRY_VERIFY(!sc); +} + + QTEST_MAIN(tst_QShortcut) #include "tst_qshortcut.moc" diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 51049ecd81..3e372b76f5 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -7704,9 +7704,7 @@ void tst_QWidget::moveWindowInShowEvent() void tst_QWidget::repaintWhenChildDeleted() { #ifdef Q_OS_WIN - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::WindowsVista) { - QTest::qWait(1000); - } + QTest::qWait(1000); #endif ColorWidget w(nullptr, Qt::FramelessWindowHint, Qt::red); w.setWindowTitle(QLatin1String(QTest::currentTestFunction())); @@ -8903,13 +8901,13 @@ void tst_QWidget::translucentWidget() #ifdef Q_OS_WIN QWidget *desktopWidget = QApplication::desktop()->screen(0); - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::WindowsVista) - widgetSnapshot = grabWindow(desktopWidget->windowHandle(), labelPos.x(), labelPos.y(), label.width(), label.height()); - else + widgetSnapshot = grabWindow(desktopWidget->windowHandle(), labelPos.x(), labelPos.y(), label.width(), label.height()); +#else + widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size())); #endif - widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size())); const QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32); - const QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size()); + QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size()); + expected.setDevicePixelRatio(label.devicePixelRatioF()); if (m_platform == QStringLiteral("winrt")) QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort); QCOMPARE(actual.size(),expected.size()); |