diff options
| author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-10-12 23:00:20 +0300 |
|---|---|---|
| committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-10-12 23:00:20 +0300 |
| commit | 4826f86e274f1b29bd769e6790824f9e62a40f62 (patch) | |
| tree | c2cc4bb09ca91951a2641e33c3b0a65deb0af877 /tests/auto/quickcontrols/qquickapplicationwindow/tst_qquickapplicationwindow.cpp | |
| parent | 0f0972d542d9869c2dcfaf9c963d42ff32766460 (diff) | |
| parent | 844f9b9b376838bcb44324984876f8bf99d85d38 (diff) | |
Merge tag 'v6.5.7-lts-lgpl' into 6.56.5
Qt 6.5.7-lts-lgpl release
Diffstat (limited to 'tests/auto/quickcontrols/qquickapplicationwindow/tst_qquickapplicationwindow.cpp')
| -rw-r--r-- | tests/auto/quickcontrols/qquickapplicationwindow/tst_qquickapplicationwindow.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols/qquickapplicationwindow/tst_qquickapplicationwindow.cpp b/tests/auto/quickcontrols/qquickapplicationwindow/tst_qquickapplicationwindow.cpp index c7a5df4b68..a02ab9c595 100644 --- a/tests/auto/quickcontrols/qquickapplicationwindow/tst_qquickapplicationwindow.cpp +++ b/tests/auto/quickcontrols/qquickapplicationwindow/tst_qquickapplicationwindow.cpp @@ -12,6 +12,7 @@ #include <QtQuickTestUtils/private/qmlutils_p.h> #include <QtQuickTestUtils/private/visualtestutils_p.h> #include <QtGui/private/qguiapplication_p.h> +#include <QtQuickTemplates2/private/qquickabstractbutton_p.h> #include <QtQuickTemplates2/private/qquickapplicationwindow_p.h> #include <QtQuickTemplates2/private/qquickoverlay_p.h> #include <QtQuickTemplates2/private/qquickcontrol_p.h> @@ -53,6 +54,7 @@ private slots: void componentComplete(); void opacity(); void backgroundSize(); + void explicitBackgroundSizeBinding(); }; tst_QQuickApplicationWindow::tst_QQuickApplicationWindow() @@ -978,6 +980,23 @@ void tst_QQuickApplicationWindow::backgroundSize() QCOMPARE(background->height(), 678); } +void tst_QQuickApplicationWindow::explicitBackgroundSizeBinding() +{ + QQuickControlsApplicationHelper helper(this, QLatin1String("explicitBackgroundSizeBinding.qml")); + QVERIFY2(helper.ready, helper.failureMessage()); + QQuickApplicationWindow *window = helper.appWindow; + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + auto *background = window->background(); + QCOMPARE(background->width(), window->width()); + QCOMPARE(background->height(), window->height()); + + window->setProperty("scaleFactor", 0.5); + QCOMPARE(background->width(), window->width() / 2); + QCOMPARE(background->height(), window->height() / 2); +} + QTEST_MAIN(tst_QQuickApplicationWindow) #include "tst_qquickapplicationwindow.moc" |
