2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
2024-02-22 14:51:16 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2015-07-20 15:27:05 +00:00
|
|
|
|
|
|
|
#include <qtest.h>
|
2020-05-26 08:16:34 +00:00
|
|
|
#include <QtCore/qoperatingsystemversion.h>
|
2015-07-20 15:27:05 +00:00
|
|
|
#include <QtTest/QSignalSpy>
|
|
|
|
#include <QtQml/qqmlengine.h>
|
|
|
|
#include <QtQml/qqmlcomponent.h>
|
|
|
|
#include <QtQml/qqmlcontext.h>
|
|
|
|
#include <QtQuick/qquickview.h>
|
|
|
|
#include <QtQuick/private/qquickitem_p.h>
|
2025-04-17 02:34:11 +00:00
|
|
|
#include <QtQuick/private/qquickmousearea_p.h>
|
2025-02-24 07:30:38 +00:00
|
|
|
#include <QtQuickTest/quicktest.h>
|
2021-08-06 10:27:35 +00:00
|
|
|
#include <QtQuickTestUtils/private/qmlutils_p.h>
|
|
|
|
#include <QtQuickTestUtils/private/visualtestutils_p.h>
|
2016-01-28 10:13:46 +00:00
|
|
|
#include <QtGui/private/qguiapplication_p.h>
|
2024-04-26 02:41:38 +00:00
|
|
|
#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
|
2016-04-13 13:59:53 +00:00
|
|
|
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
|
|
|
|
#include <QtQuickTemplates2/private/qquickoverlay_p.h>
|
|
|
|
#include <QtQuickTemplates2/private/qquickcontrol_p.h>
|
2025-04-17 02:34:11 +00:00
|
|
|
#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
|
2016-04-13 13:59:53 +00:00
|
|
|
#include <QtQuickTemplates2/private/qquicklabel_p.h>
|
2017-07-10 14:48:07 +00:00
|
|
|
#include <QtQuickTemplates2/private/qquickmenu_p.h>
|
|
|
|
#include <QtQuickTemplates2/private/qquickpopup_p.h>
|
2016-04-13 13:59:53 +00:00
|
|
|
#include <QtQuickTemplates2/private/qquicktextarea_p.h>
|
|
|
|
#include <QtQuickTemplates2/private/qquicktextfield_p.h>
|
2018-05-15 21:29:46 +00:00
|
|
|
#include <QtQuickTemplates2/private/qquicktheme_p_p.h>
|
2021-08-06 10:27:35 +00:00
|
|
|
#include <QtQuickControls2/qquickstyle.h>
|
2024-03-11 05:03:30 +00:00
|
|
|
#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
|
2015-07-20 15:27:05 +00:00
|
|
|
|
2021-08-06 10:27:35 +00:00
|
|
|
using namespace QQuickVisualTestUtils;
|
2024-03-11 05:03:30 +00:00
|
|
|
using namespace QQuickControlsTestUtils;
|
2015-07-20 15:27:05 +00:00
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
class tst_QQuickApplicationWindow : public QQmlDataTest
|
2015-07-20 15:27:05 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-09-30 12:22:42 +00:00
|
|
|
|
2015-07-20 15:27:05 +00:00
|
|
|
public:
|
2020-09-30 12:22:42 +00:00
|
|
|
tst_QQuickApplicationWindow();
|
2015-07-20 15:27:05 +00:00
|
|
|
|
|
|
|
private slots:
|
2015-10-12 22:01:17 +00:00
|
|
|
void qmlCreation();
|
|
|
|
void activeFocusOnTab1();
|
|
|
|
void activeFocusOnTab2();
|
|
|
|
void defaultFocus();
|
2015-07-20 15:27:05 +00:00
|
|
|
void implicitFill();
|
2015-11-14 10:47:59 +00:00
|
|
|
void attachedProperties();
|
2015-12-03 12:23:27 +00:00
|
|
|
void font();
|
2016-01-28 10:13:46 +00:00
|
|
|
void defaultFont();
|
2015-12-21 11:26:02 +00:00
|
|
|
void locale();
|
2015-11-29 20:56:36 +00:00
|
|
|
void activeFocusControl_data();
|
|
|
|
void activeFocusControl();
|
2016-05-10 10:44:15 +00:00
|
|
|
void focusAfterPopupClosed();
|
2017-01-03 12:46:46 +00:00
|
|
|
void clearFocusOnDestruction();
|
2016-08-08 18:50:13 +00:00
|
|
|
void layout();
|
2021-06-11 14:31:30 +00:00
|
|
|
void layoutLayout();
|
2017-04-21 05:45:13 +00:00
|
|
|
void componentComplete();
|
2020-03-27 10:17:35 +00:00
|
|
|
void opacity();
|
2024-03-11 05:03:30 +00:00
|
|
|
void backgroundSize();
|
2024-04-26 02:41:38 +00:00
|
|
|
void explicitBackgroundSizeBinding();
|
Teach ApplicationWindow about safe area margins
If the window has non-safe areas, as reflected by the window's
safe area margins, ApplicationWindow will now automatically
pad the content item accordingly, ensuring that the content
item is within the safe area of the window.
To implement this we piggy-back on QQuickControl, letting
the control manage the size and position of the content
item. This allows us to use the built in padding of
QQuickControl to inset the content.
Internally the item hierarchy of ApplicationWindow no
longer represents the header, footer, and menu bar as
children of the ApplicationWindow's content item, but
rather as sibling items in the QQuickWindow content item,
similar to the window's background item.
Doing this is a slight behavior change, but for something
that should have been an implementation detail as far as
users are concerned.
The content control and header, footer and menu bar now all
live within the same root QQuickWindow::contentItem, which
is a focus scope on its own.
End users can override the automatic padding that we do
for the contentItem by setting any of the four new padding
properties that we expose, mirroring the properties on
QQuickControl.
[ChangeLog][Important Behavior Changes] The contentItem
of ApplicationWindow is now automatically padded to
account for safe area margins. To override the automatic
padding, set the padding explicitly, via e.g.
`topPadding: 0`.
Task-number: QTBUG-125373
Change-Id: I986e425a7f316db244c7fc86283b8b333978e3ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-17 14:35:26 +00:00
|
|
|
void safeArea();
|
2025-06-26 09:26:43 +00:00
|
|
|
void paintOrderChildItems();
|
2025-04-25 07:25:25 +00:00
|
|
|
#if QT_CONFIG(quicktemplates2_hover)
|
2025-04-17 02:34:11 +00:00
|
|
|
void hoverInBackground();
|
2025-04-25 07:25:25 +00:00
|
|
|
#endif
|
2015-07-20 15:27:05 +00:00
|
|
|
};
|
|
|
|
|
2020-09-30 12:22:42 +00:00
|
|
|
tst_QQuickApplicationWindow::tst_QQuickApplicationWindow()
|
2021-08-06 10:27:35 +00:00
|
|
|
: QQmlDataTest(QT_QMLTEST_DATADIR)
|
2020-09-30 12:22:42 +00:00
|
|
|
{
|
2024-03-14 03:36:06 +00:00
|
|
|
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuWindows);
|
|
|
|
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
|
2020-09-30 12:22:42 +00:00
|
|
|
QQuickStyle::setStyle("Basic");
|
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::qmlCreation()
|
2015-10-12 22:01:17 +00:00
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("basicapplicationwindow.qml"));
|
|
|
|
QObject* created = component.create();
|
|
|
|
QScopedPointer<QObject> cleanup(created);
|
|
|
|
QVERIFY(created);
|
|
|
|
|
|
|
|
QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
|
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(!window->isVisible());
|
|
|
|
|
|
|
|
QCOMPARE(created->property("title"), QVariant("Test Application Window"));
|
|
|
|
|
|
|
|
QQuickItem* statusBar = qvariant_cast<QQuickItem*>(created->property("statusBar"));
|
|
|
|
QVERIFY(!statusBar);
|
|
|
|
|
|
|
|
QQuickItem* header = qvariant_cast<QQuickItem*>(created->property("header"));
|
|
|
|
QVERIFY(!header);
|
|
|
|
|
|
|
|
QQuickItem* footer = qvariant_cast<QQuickItem*>(created->property("footer"));
|
|
|
|
QVERIFY(!footer);
|
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::activeFocusOnTab1()
|
2015-10-12 22:01:17 +00:00
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("activefocusontab.qml"));
|
|
|
|
QObject* created = component.create();
|
|
|
|
QScopedPointer<QObject> cleanup(created);
|
|
|
|
QVERIFY(created);
|
|
|
|
|
|
|
|
QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
|
|
|
|
QVERIFY(window);
|
|
|
|
window->show();
|
|
|
|
window->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
QVERIFY(QGuiApplication::focusWindow() == window);
|
|
|
|
|
|
|
|
QQuickItem* contentItem = window->contentItem();
|
|
|
|
QVERIFY(contentItem);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(contentItem);
|
2015-10-12 22:01:17 +00:00
|
|
|
|
|
|
|
QQuickItem* item = findItem<QQuickItem>(window->contentItem(), "sub1");
|
|
|
|
QVERIFY(item);
|
|
|
|
QVERIFY(!item->hasActiveFocus());
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// Tab: contentItem->menuBar
|
2020-11-11 13:51:05 +00:00
|
|
|
{
|
2025-06-26 09:26:43 +00:00
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier);
|
2020-11-11 13:51:05 +00:00
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
item = qobject_cast<QQuickApplicationWindow *>(window)->menuBar();
|
2020-11-11 13:51:05 +00:00
|
|
|
QVERIFY(item);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
2020-11-11 13:51:05 +00:00
|
|
|
}
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// Tab: menuBar->header
|
2020-11-11 13:51:05 +00:00
|
|
|
{
|
2025-06-26 09:26:43 +00:00
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier);
|
2020-11-11 13:51:05 +00:00
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
item = qobject_cast<QQuickApplicationWindow *>(window)->header();
|
2020-11-11 13:51:05 +00:00
|
|
|
QVERIFY(item);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
2020-11-11 13:51:05 +00:00
|
|
|
}
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// Tab: header->sub1
|
2020-11-11 13:51:05 +00:00
|
|
|
{
|
2025-06-26 09:26:43 +00:00
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier);
|
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
item = findItem<QQuickItem>(window->contentItem(), "sub1");
|
2025-06-26 09:26:43 +00:00
|
|
|
QVERIFY(item);
|
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
|
|
|
}
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// Tab: sub1->sub2
|
2025-06-26 09:26:43 +00:00
|
|
|
{
|
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier);
|
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
item = findItem<QQuickItem>(window->contentItem(), "sub2");
|
2025-06-26 09:26:43 +00:00
|
|
|
QVERIFY(item);
|
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
|
|
|
}
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// Tab: sub2->footer
|
2025-06-26 09:26:43 +00:00
|
|
|
{
|
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier);
|
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
|
|
|
|
|
|
|
item = qobject_cast<QQuickApplicationWindow *>(window)->footer();
|
|
|
|
QVERIFY(item);
|
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
|
|
|
}
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// Tab: footer->menuBar
|
2025-06-26 09:26:43 +00:00
|
|
|
{
|
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier);
|
2020-11-11 13:51:05 +00:00
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
|
|
|
|
|
|
|
item = findItem<QQuickItem>(window->contentItem(), "sub1");
|
2025-06-26 09:47:29 +00:00
|
|
|
item = qobject_cast<QQuickApplicationWindow *>(window)->menuBar();
|
2020-11-11 13:51:05 +00:00
|
|
|
QVERIFY(item);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
2020-11-11 13:51:05 +00:00
|
|
|
}
|
2015-10-12 22:01:17 +00:00
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::activeFocusOnTab2()
|
2015-10-12 22:01:17 +00:00
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("activefocusontab.qml"));
|
|
|
|
QObject* created = component.create();
|
|
|
|
QScopedPointer<QObject> cleanup(created);
|
|
|
|
QVERIFY(created);
|
|
|
|
|
|
|
|
QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
|
|
|
|
QVERIFY(window);
|
|
|
|
window->show();
|
|
|
|
window->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
QVERIFY(QGuiApplication::focusWindow() == window);
|
|
|
|
|
|
|
|
QQuickItem* contentItem = window->contentItem();
|
|
|
|
QVERIFY(contentItem);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(contentItem);
|
2015-10-12 22:01:17 +00:00
|
|
|
|
|
|
|
QQuickItem* item = findItem<QQuickItem>(window->contentItem(), "sub2");
|
|
|
|
QVERIFY(item);
|
|
|
|
QVERIFY(!item->hasActiveFocus());
|
|
|
|
|
2025-06-26 09:26:43 +00:00
|
|
|
// BackTab: contentItem->footer
|
|
|
|
{
|
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier);
|
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
|
|
|
|
|
|
|
item = qobject_cast<QQuickApplicationWindow *>(window)->footer();
|
|
|
|
QVERIFY(item);
|
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
|
|
|
}
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// BackTab: footer->sub2
|
2020-11-11 13:51:05 +00:00
|
|
|
{
|
2025-06-26 09:26:43 +00:00
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier);
|
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
item = findItem<QQuickItem>(window->contentItem(), "sub2");
|
2025-06-26 09:26:43 +00:00
|
|
|
QVERIFY(item);
|
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
|
|
|
}
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// BackTab: sub2->sub1
|
2025-06-26 09:26:43 +00:00
|
|
|
{
|
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier);
|
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
item = findItem<QQuickItem>(window->contentItem(), "sub1");
|
2025-06-26 09:26:43 +00:00
|
|
|
QVERIFY(item);
|
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
|
|
|
}
|
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// BackTab: sub1->header
|
2025-06-26 09:26:43 +00:00
|
|
|
{
|
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier);
|
2020-11-11 13:51:05 +00:00
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
item = qobject_cast<QQuickApplicationWindow *>(window)->header();
|
2020-11-11 13:51:05 +00:00
|
|
|
QVERIFY(item);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
2020-11-11 13:51:05 +00:00
|
|
|
}
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// BackTab: header->menuBar
|
2020-11-11 13:51:05 +00:00
|
|
|
{
|
2025-06-26 09:26:43 +00:00
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier);
|
2020-11-11 13:51:05 +00:00
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
item = qobject_cast<QQuickApplicationWindow *>(window)->menuBar();
|
2020-11-11 13:51:05 +00:00
|
|
|
QVERIFY(item);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
2020-11-11 13:51:05 +00:00
|
|
|
}
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2025-06-26 09:47:29 +00:00
|
|
|
// BackTab: menuBar->footer
|
2020-11-11 13:51:05 +00:00
|
|
|
{
|
2025-06-26 09:26:43 +00:00
|
|
|
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier);
|
2020-11-11 13:51:05 +00:00
|
|
|
QGuiApplication::sendEvent(window, &key);
|
|
|
|
QVERIFY(key.isAccepted());
|
|
|
|
|
2025-06-26 09:26:43 +00:00
|
|
|
item = qobject_cast<QQuickApplicationWindow *>(window)->footer();
|
2020-11-11 13:51:05 +00:00
|
|
|
QVERIFY(item);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
2020-11-11 13:51:05 +00:00
|
|
|
}
|
2015-10-12 22:01:17 +00:00
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::defaultFocus()
|
2015-10-12 22:01:17 +00:00
|
|
|
{
|
2024-12-10 19:16:14 +00:00
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("defaultFocus.qml"));
|
|
|
|
QObject* created = component.create();
|
|
|
|
QScopedPointer<QObject> cleanup(created);
|
|
|
|
Q_UNUSED(cleanup);
|
|
|
|
QVERIFY(created);
|
2024-12-09 11:29:27 +00:00
|
|
|
|
2024-12-10 19:16:14 +00:00
|
|
|
QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
|
2015-10-12 22:01:17 +00:00
|
|
|
QVERIFY(window);
|
|
|
|
window->show();
|
|
|
|
window->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
QVERIFY(QGuiApplication::focusWindow() == window);
|
|
|
|
|
|
|
|
QQuickItem* contentItem = window->contentItem();
|
|
|
|
QVERIFY(contentItem);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(contentItem);
|
2015-10-12 22:01:17 +00:00
|
|
|
|
2024-12-10 19:16:14 +00:00
|
|
|
// A single item in an ApplicationWindow with focus: true should receive focus.
|
2015-10-12 22:01:17 +00:00
|
|
|
QQuickItem* item = findItem<QQuickItem>(window->contentItem(), "item");
|
|
|
|
QVERIFY(item);
|
2024-12-10 19:16:14 +00:00
|
|
|
QVERIFY(item->hasFocus());
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(item);
|
2015-10-12 22:01:17 +00:00
|
|
|
}
|
2015-07-20 15:27:05 +00:00
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::implicitFill()
|
2015-07-20 15:27:05 +00:00
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("fill.qml"));
|
|
|
|
QObject* created = component.create();
|
|
|
|
QScopedPointer<QObject> cleanup(created);
|
|
|
|
QVERIFY(created);
|
|
|
|
|
2025-05-30 08:56:16 +00:00
|
|
|
QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(created);
|
2015-07-20 15:27:05 +00:00
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(!window->isVisible());
|
|
|
|
QCOMPARE(window->width(), 400);
|
|
|
|
QCOMPARE(window->height(), 400);
|
|
|
|
|
|
|
|
window->show();
|
2024-08-20 10:59:35 +00:00
|
|
|
window->requestActivate();
|
2015-07-20 15:27:05 +00:00
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
|
2025-05-30 08:56:16 +00:00
|
|
|
const QSizeF expectedSize = window->contentItem()->size();
|
2022-04-14 16:00:56 +00:00
|
|
|
|
2015-07-20 15:27:05 +00:00
|
|
|
QQuickItem *stackView = window->property("stackView").value<QQuickItem*>();
|
|
|
|
QVERIFY(stackView);
|
2022-04-14 16:00:56 +00:00
|
|
|
QCOMPARE(stackView->width(), expectedSize.width());
|
|
|
|
QCOMPARE(stackView->height(), expectedSize.height());
|
2015-07-20 15:27:05 +00:00
|
|
|
|
|
|
|
QQuickItem *nextItem = window->property("nextItem").value<QQuickItem*>();
|
|
|
|
QVERIFY(nextItem);
|
|
|
|
|
|
|
|
QVERIFY(QMetaObject::invokeMethod(window, "pushNextItem"));
|
2022-04-14 16:00:56 +00:00
|
|
|
QCOMPARE(nextItem->width(), expectedSize.width());
|
|
|
|
QCOMPARE(nextItem->height(), expectedSize.height());
|
2015-07-20 15:27:05 +00:00
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::attachedProperties()
|
2015-11-14 10:47:59 +00:00
|
|
|
{
|
2024-04-22 14:04:28 +00:00
|
|
|
if (QGuiApplication::platformName().startsWith(QLatin1String("eglfs"), Qt::CaseInsensitive))
|
|
|
|
{
|
|
|
|
QSKIP("This test uses multiple windows and it crashes on EGLFS because of that");
|
|
|
|
}
|
2015-11-14 10:47:59 +00:00
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("attachedProperties.qml"));
|
|
|
|
|
|
|
|
QScopedPointer<QObject> object(component.create());
|
|
|
|
QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
|
|
|
|
|
|
|
|
QQuickApplicationWindow *window = qobject_cast<QQuickApplicationWindow *>(object.data());
|
|
|
|
QVERIFY(window);
|
|
|
|
|
2015-11-29 20:56:36 +00:00
|
|
|
QQuickItem *childControl = object->property("childControl").value<QQuickItem *>();
|
|
|
|
QVERIFY(childControl);
|
|
|
|
QCOMPARE(childControl->property("attached_window").value<QQuickApplicationWindow *>(), window);
|
|
|
|
QCOMPARE(childControl->property("attached_contentItem").value<QQuickItem *>(), window->contentItem());
|
|
|
|
QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), window->activeFocusControl());
|
|
|
|
QCOMPARE(childControl->property("attached_header").value<QQuickItem *>(), window->header());
|
|
|
|
QCOMPARE(childControl->property("attached_footer").value<QQuickItem *>(), window->footer());
|
|
|
|
|
2015-11-14 10:47:59 +00:00
|
|
|
QQuickItem *childItem = object->property("childItem").value<QQuickItem *>();
|
|
|
|
QVERIFY(childItem);
|
|
|
|
QCOMPARE(childItem->property("attached_window").value<QQuickApplicationWindow *>(), window);
|
|
|
|
QCOMPARE(childItem->property("attached_contentItem").value<QQuickItem *>(), window->contentItem());
|
2015-11-29 20:56:36 +00:00
|
|
|
QCOMPARE(childItem->property("attached_activeFocusControl").value<QQuickItem *>(), window->activeFocusControl());
|
2015-11-14 10:47:59 +00:00
|
|
|
QCOMPARE(childItem->property("attached_header").value<QQuickItem *>(), window->header());
|
|
|
|
QCOMPARE(childItem->property("attached_footer").value<QQuickItem *>(), window->footer());
|
|
|
|
|
|
|
|
QObject *childObject = object->property("childObject").value<QObject *>();
|
|
|
|
QVERIFY(childObject);
|
|
|
|
QVERIFY(!childObject->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childObject->property("attached_contentItem").value<QQuickItem *>());
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childObject->property("attached_activeFocusControl").value<QQuickItem *>());
|
2015-11-14 10:47:59 +00:00
|
|
|
QVERIFY(!childObject->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childObject->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
|
|
|
QQuickWindow *childWindow = object->property("childWindow").value<QQuickWindow *>();
|
|
|
|
QVERIFY(childWindow);
|
|
|
|
QVERIFY(!childWindow->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childWindow->property("attached_contentItem").value<QQuickItem *>());
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childWindow->property("attached_activeFocusControl").value<QQuickItem *>());
|
2015-11-14 10:47:59 +00:00
|
|
|
QVERIFY(!childWindow->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childWindow->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
2015-11-29 20:56:36 +00:00
|
|
|
QQuickItem *childWindowControl = object->property("childWindowControl").value<QQuickItem *>();
|
|
|
|
QVERIFY(childWindowControl);
|
|
|
|
QVERIFY(!childWindowControl->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childWindowControl->property("attached_contentItem").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childWindowControl->property("attached_activeFocusControl").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childWindowControl->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childWindowControl->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
2015-11-14 10:47:59 +00:00
|
|
|
QQuickItem *childWindowItem = object->property("childWindowItem").value<QQuickItem *>();
|
|
|
|
QVERIFY(childWindowItem);
|
|
|
|
QVERIFY(!childWindowItem->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childWindowItem->property("attached_contentItem").value<QQuickItem *>());
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childWindowItem->property("attached_activeFocusControl").value<QQuickItem *>());
|
2015-11-14 10:47:59 +00:00
|
|
|
QVERIFY(!childWindowItem->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childWindowItem->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
|
|
|
QObject *childWindowObject = object->property("childWindowObject").value<QObject *>();
|
|
|
|
QVERIFY(childWindowObject);
|
|
|
|
QVERIFY(!childWindowObject->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childWindowObject->property("attached_contentItem").value<QQuickItem *>());
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childWindowObject->property("attached_activeFocusControl").value<QQuickItem *>());
|
2015-11-14 10:47:59 +00:00
|
|
|
QVERIFY(!childWindowObject->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childWindowObject->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
|
|
|
QQuickApplicationWindow *childAppWindow = object->property("childAppWindow").value<QQuickApplicationWindow *>();
|
|
|
|
QVERIFY(childAppWindow);
|
|
|
|
QVERIFY(!childAppWindow->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childAppWindow->property("attached_contentItem").value<QQuickItem *>());
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childAppWindow->property("attached_activeFocusControl").value<QQuickItem *>());
|
2015-11-14 10:47:59 +00:00
|
|
|
QVERIFY(!childAppWindow->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childAppWindow->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
2015-11-29 20:56:36 +00:00
|
|
|
QQuickItem *childAppWindowControl = object->property("childAppWindowControl").value<QQuickItem *>();
|
|
|
|
QVERIFY(childAppWindowControl);
|
|
|
|
QCOMPARE(childAppWindowControl->property("attached_window").value<QQuickApplicationWindow *>(), childAppWindow);
|
|
|
|
QCOMPARE(childAppWindowControl->property("attached_contentItem").value<QQuickItem *>(), childAppWindow->contentItem());
|
|
|
|
QCOMPARE(childAppWindowControl->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindow->activeFocusControl());
|
|
|
|
QCOMPARE(childAppWindowControl->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
|
|
|
|
QCOMPARE(childAppWindowControl->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
|
|
|
|
|
2015-11-14 10:47:59 +00:00
|
|
|
QQuickItem *childAppWindowItem = object->property("childAppWindowItem").value<QQuickItem *>();
|
|
|
|
QVERIFY(childAppWindowItem);
|
|
|
|
QCOMPARE(childAppWindowItem->property("attached_window").value<QQuickApplicationWindow *>(), childAppWindow);
|
|
|
|
QCOMPARE(childAppWindowItem->property("attached_contentItem").value<QQuickItem *>(), childAppWindow->contentItem());
|
2015-11-29 20:56:36 +00:00
|
|
|
QCOMPARE(childAppWindowItem->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindow->activeFocusControl());
|
2015-11-14 10:47:59 +00:00
|
|
|
QCOMPARE(childAppWindowItem->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
|
|
|
|
QCOMPARE(childAppWindowItem->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
|
|
|
|
|
|
|
|
QObject *childAppWindowObject = object->property("childAppWindowObject").value<QObject *>();
|
|
|
|
QVERIFY(childAppWindowObject);
|
|
|
|
QVERIFY(!childAppWindowObject->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childAppWindowObject->property("attached_contentItem").value<QQuickItem *>());
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childAppWindowObject->property("attached_activeFocusControl").value<QQuickItem *>());
|
2015-11-14 10:47:59 +00:00
|
|
|
QVERIFY(!childAppWindowObject->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childAppWindowObject->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
|
|
|
window->show();
|
|
|
|
window->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childControl->hasActiveFocus());
|
|
|
|
childControl->forceActiveFocus();
|
2025-02-24 07:30:38 +00:00
|
|
|
QTRY_VERIFY_ACTIVE_FOCUS(childControl);
|
2015-11-29 20:56:36 +00:00
|
|
|
QCOMPARE(window->activeFocusItem(), childControl);
|
|
|
|
QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childControl);
|
2015-11-14 10:47:59 +00:00
|
|
|
|
|
|
|
QQuickItem *header = new QQuickItem;
|
|
|
|
window->setHeader(header);
|
|
|
|
QCOMPARE(window->header(), header);
|
2015-11-29 20:56:36 +00:00
|
|
|
QCOMPARE(childControl->property("attached_header").value<QQuickItem *>(), header);
|
2015-11-14 10:47:59 +00:00
|
|
|
|
|
|
|
QQuickItem *footer = new QQuickItem;
|
|
|
|
window->setFooter(footer);
|
|
|
|
QCOMPARE(window->footer(), footer);
|
2015-11-29 20:56:36 +00:00
|
|
|
QCOMPARE(childControl->property("attached_footer").value<QQuickItem *>(), footer);
|
2015-11-14 10:47:59 +00:00
|
|
|
|
|
|
|
childAppWindow->show();
|
|
|
|
childAppWindow->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(childAppWindow));
|
|
|
|
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childAppWindowControl->hasActiveFocus());
|
|
|
|
childAppWindowControl->forceActiveFocus();
|
2025-02-24 07:30:38 +00:00
|
|
|
QTRY_VERIFY_ACTIVE_FOCUS(childAppWindowControl);
|
2015-11-29 20:56:36 +00:00
|
|
|
QCOMPARE(childAppWindow->activeFocusItem(), childAppWindowControl);
|
|
|
|
QCOMPARE(childAppWindowControl->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindowControl);
|
|
|
|
|
|
|
|
childControl->setParentItem(childAppWindow->contentItem());
|
|
|
|
QCOMPARE(childControl->window(), childAppWindow);
|
|
|
|
QCOMPARE(childControl->property("attached_window").value<QQuickApplicationWindow *>(), childAppWindow);
|
|
|
|
QCOMPARE(childControl->property("attached_contentItem").value<QQuickItem *>(), childAppWindow->contentItem());
|
2017-06-24 08:18:43 +00:00
|
|
|
QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindowControl);
|
2015-11-29 20:56:36 +00:00
|
|
|
QCOMPARE(childControl->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
|
|
|
|
QCOMPARE(childControl->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
|
2015-11-14 10:47:59 +00:00
|
|
|
|
|
|
|
childItem->setParentItem(childAppWindow->contentItem());
|
|
|
|
QCOMPARE(childItem->window(), childAppWindow);
|
|
|
|
QCOMPARE(childItem->property("attached_window").value<QQuickApplicationWindow *>(), childAppWindow);
|
|
|
|
QCOMPARE(childItem->property("attached_contentItem").value<QQuickItem *>(), childAppWindow->contentItem());
|
2017-06-24 08:18:43 +00:00
|
|
|
QCOMPARE(childItem->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindowControl);
|
2015-11-14 10:47:59 +00:00
|
|
|
QCOMPARE(childItem->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
|
|
|
|
QCOMPARE(childItem->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
|
|
|
|
|
2016-01-20 16:31:18 +00:00
|
|
|
childControl->setParentItem(nullptr);
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childControl->window());
|
|
|
|
QVERIFY(!childControl->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_activeFocusControl").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
2016-01-20 16:31:18 +00:00
|
|
|
childItem->setParentItem(nullptr);
|
2015-11-14 10:47:59 +00:00
|
|
|
QVERIFY(!childItem->window());
|
|
|
|
QVERIFY(!childItem->property("attached_window").value<QQuickApplicationWindow *>());
|
|
|
|
QVERIFY(!childItem->property("attached_contentItem").value<QQuickItem *>());
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(!childItem->property("attached_activeFocusControl").value<QQuickItem *>());
|
2015-11-14 10:47:59 +00:00
|
|
|
QVERIFY(!childItem->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childItem->property("attached_footer").value<QQuickItem *>());
|
2017-06-29 09:28:42 +00:00
|
|
|
childAppWindow->close();
|
|
|
|
qApp->processEvents();
|
2017-06-24 08:18:43 +00:00
|
|
|
|
|
|
|
childWindow->show();
|
|
|
|
childWindow->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(childWindow));
|
|
|
|
|
|
|
|
QVERIFY(!childWindowControl->hasActiveFocus());
|
|
|
|
childWindowControl->forceActiveFocus();
|
2025-02-24 07:30:38 +00:00
|
|
|
QTRY_VERIFY_ACTIVE_FOCUS(childWindowControl);
|
2017-06-24 08:18:43 +00:00
|
|
|
QCOMPARE(childWindow->activeFocusItem(), childWindowControl);
|
|
|
|
QCOMPARE(childWindowControl->property("attached_activeFocusControl").value<QQuickItem *>(), childWindowControl);
|
|
|
|
|
|
|
|
childControl->setParentItem(childWindow->contentItem());
|
|
|
|
QCOMPARE(childControl->window(), childWindow);
|
|
|
|
QVERIFY(!childControl->property("attached_window").value<QQuickWindow *>());
|
|
|
|
QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childWindowControl);
|
|
|
|
QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
|
|
|
childItem->setParentItem(childWindow->contentItem());
|
|
|
|
QCOMPARE(childItem->window(), childWindow);
|
|
|
|
QVERIFY(!childControl->property("attached_window").value<QQuickWindow *>());
|
|
|
|
QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childWindowControl);
|
|
|
|
QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
|
|
|
childControl->setParentItem(nullptr);
|
|
|
|
QVERIFY(!childControl->window());
|
|
|
|
QVERIFY(!childControl->property("attached_window").value<QQuickWindow *>());
|
|
|
|
QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_activeFocusControl").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
|
|
|
|
|
|
|
|
childItem->setParentItem(nullptr);
|
|
|
|
QVERIFY(!childItem->window());
|
|
|
|
QVERIFY(!childItem->property("attached_window").value<QQuickWindow *>());
|
|
|
|
QVERIFY(!childItem->property("attached_contentItem").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childItem->property("attached_activeFocusControl").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childItem->property("attached_header").value<QQuickItem *>());
|
|
|
|
QVERIFY(!childItem->property("attached_footer").value<QQuickItem *>());
|
2017-06-29 09:28:42 +00:00
|
|
|
childWindow->close();
|
2015-11-14 10:47:59 +00:00
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::font()
|
2015-12-03 12:23:27 +00:00
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("font.qml"));
|
|
|
|
QObject* created = component.create();
|
|
|
|
QScopedPointer<QObject> cleanup(created);
|
|
|
|
QVERIFY(created);
|
|
|
|
|
|
|
|
QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(created);
|
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(!window->isVisible());
|
|
|
|
QCOMPARE(window->width(), 400);
|
|
|
|
QCOMPARE(window->height(), 400);
|
|
|
|
|
|
|
|
window->show();
|
2024-08-20 10:59:35 +00:00
|
|
|
window->requestActivate();
|
2015-12-03 12:23:27 +00:00
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
|
|
|
|
QFont font = window->font();
|
|
|
|
|
2025-05-30 08:56:16 +00:00
|
|
|
const QSizeF expectedSize = window->contentItem()->size();
|
2022-04-14 16:00:56 +00:00
|
|
|
|
2015-12-03 12:23:27 +00:00
|
|
|
QQuickControl *mainItem = window->property("mainItem").value<QQuickControl*>();
|
|
|
|
QVERIFY(mainItem);
|
2022-04-14 16:00:56 +00:00
|
|
|
QCOMPARE(mainItem->width(), expectedSize.width());
|
|
|
|
QCOMPARE(mainItem->height(), expectedSize.height());
|
2015-12-03 12:23:27 +00:00
|
|
|
QCOMPARE(mainItem->font(), font);
|
|
|
|
|
|
|
|
QQuickControl *item2 = mainItem->property("item_2").value<QQuickControl*>();
|
|
|
|
QVERIFY(item2);
|
|
|
|
QQuickControl *item3 = mainItem->property("item_3").value<QQuickControl*>();
|
|
|
|
QVERIFY(item3);
|
|
|
|
QQuickTextArea *item4 = mainItem->property("item_4").value<QQuickTextArea*>();
|
|
|
|
QVERIFY(item4);
|
|
|
|
QQuickTextField *item5 = mainItem->property("item_5").value<QQuickTextField*>();
|
|
|
|
QVERIFY(item5);
|
|
|
|
QQuickLabel *item6 = mainItem->property("item_6").value<QQuickLabel*>();
|
|
|
|
QVERIFY(item6);
|
|
|
|
|
|
|
|
QCOMPARE(item2->font(), font);
|
|
|
|
QCOMPARE(item3->font(), font);
|
|
|
|
QCOMPARE(item4->font(), font);
|
|
|
|
QCOMPARE(item5->font(), font);
|
|
|
|
QCOMPARE(item6->font(), font);
|
|
|
|
|
|
|
|
int pointSize = font.pointSize();
|
|
|
|
font.setPixelSize(pointSize + 5);
|
|
|
|
window->setFont(font);
|
|
|
|
|
|
|
|
QCOMPARE(window->font(), font);
|
|
|
|
QCOMPARE(mainItem->font(), font);
|
|
|
|
QCOMPARE(item2->font(), font);
|
|
|
|
QCOMPARE(item3->font(), font);
|
|
|
|
QCOMPARE(item4->font(), font);
|
|
|
|
QCOMPARE(item5->font(), font);
|
|
|
|
QCOMPARE(item6->font(), font);
|
|
|
|
}
|
2015-12-21 11:26:02 +00:00
|
|
|
|
2018-02-22 22:29:44 +00:00
|
|
|
class TestTheme : public QQuickTheme
|
2016-01-28 10:13:46 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-05-13 17:34:29 +00:00
|
|
|
TestTheme()
|
2016-01-28 10:13:46 +00:00
|
|
|
{
|
2018-05-16 11:50:35 +00:00
|
|
|
setFont(System, QFont("Courier"));
|
2016-01-28 10:13:46 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::defaultFont()
|
2016-01-28 10:13:46 +00:00
|
|
|
{
|
2018-05-15 21:29:46 +00:00
|
|
|
QQuickThemePrivate::instance.reset(new TestTheme);
|
2016-01-28 10:13:46 +00:00
|
|
|
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
2020-09-04 08:38:35 +00:00
|
|
|
component.setData("import QtQuick.Controls; ApplicationWindow { }", QUrl());
|
2016-01-28 10:13:46 +00:00
|
|
|
|
|
|
|
QScopedPointer<QQuickApplicationWindow> window;
|
|
|
|
window.reset(static_cast<QQuickApplicationWindow *>(component.create()));
|
|
|
|
QVERIFY(!window.isNull());
|
2018-05-16 11:57:00 +00:00
|
|
|
QCOMPARE(window->font(), QQuickTheme::font(QQuickTheme::System));
|
2016-01-28 10:13:46 +00:00
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::locale()
|
2015-12-21 11:26:02 +00:00
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("locale.qml"));
|
|
|
|
QObject* created = component.create();
|
|
|
|
QScopedPointer<QObject> cleanup(created);
|
|
|
|
QVERIFY(created);
|
|
|
|
|
|
|
|
QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(created);
|
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(!window->isVisible());
|
|
|
|
QCOMPARE(window->width(), 400);
|
|
|
|
QCOMPARE(window->height(), 400);
|
|
|
|
|
|
|
|
window->show();
|
2024-08-20 10:59:35 +00:00
|
|
|
window->requestActivate();
|
2015-12-21 11:26:02 +00:00
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
|
|
|
|
QLocale l = window->locale();
|
|
|
|
|
2025-05-30 08:56:16 +00:00
|
|
|
const QSizeF expectedSize = window->contentItem()->size();
|
2022-04-14 16:00:56 +00:00
|
|
|
|
2015-12-21 11:26:02 +00:00
|
|
|
QQuickControl *mainItem = window->property("mainItem").value<QQuickControl*>();
|
|
|
|
QVERIFY(mainItem);
|
2022-04-14 16:00:56 +00:00
|
|
|
QCOMPARE(mainItem->width(), expectedSize.width());
|
|
|
|
QCOMPARE(mainItem->height(), expectedSize.height());
|
2015-12-21 11:26:02 +00:00
|
|
|
QCOMPARE(mainItem->locale(), l);
|
|
|
|
|
|
|
|
QQuickControl *item2 = mainItem->property("item_2").value<QQuickControl*>();
|
|
|
|
QVERIFY(item2);
|
|
|
|
QQuickControl *item3 = mainItem->property("item_3").value<QQuickControl*>();
|
|
|
|
QVERIFY(item3);
|
|
|
|
|
|
|
|
QCOMPARE(item2->locale(), l);
|
|
|
|
QCOMPARE(item3->locale(), l);
|
|
|
|
|
|
|
|
l = QLocale("en_US");
|
|
|
|
window->setLocale(l);
|
|
|
|
|
|
|
|
QCOMPARE(window->locale(), l);
|
|
|
|
QCOMPARE(mainItem->locale(), l);
|
|
|
|
QCOMPARE(item2->locale(), l);
|
|
|
|
QCOMPARE(item3->locale(), l);
|
|
|
|
|
|
|
|
l = QLocale("ar_EG");
|
|
|
|
window->setLocale(l);
|
|
|
|
|
|
|
|
QCOMPARE(window->locale(), l);
|
|
|
|
QCOMPARE(mainItem->locale(), l);
|
|
|
|
QCOMPARE(item2->locale(), l);
|
|
|
|
QCOMPARE(item3->locale(), l);
|
|
|
|
}
|
2015-12-03 12:23:27 +00:00
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::activeFocusControl_data()
|
2015-11-29 20:56:36 +00:00
|
|
|
{
|
|
|
|
QTest::addColumn<QByteArray>("containerName");
|
|
|
|
QTest::addColumn<QByteArray>("activeFocusItemName");
|
|
|
|
QTest::addColumn<QByteArray>("activeFocusControlName");
|
|
|
|
|
|
|
|
QTest::newRow("Column:TextInput") << QByteArray("container_column") << QByteArray("textInput_column") << QByteArray();
|
|
|
|
QTest::newRow("Column:TextEdit") << QByteArray("container_column") << QByteArray("textEdit_column") << QByteArray();
|
|
|
|
QTest::newRow("Column:TextField") << QByteArray("container_column") << QByteArray("textField_column") << QByteArray("textField_column");
|
|
|
|
QTest::newRow("Column:TextArea") << QByteArray("container_column") << QByteArray("textArea_column") << QByteArray("textArea_column");
|
|
|
|
QTest::newRow("Column:SpinBox") << QByteArray("container_column") << QByteArray("spinContent_column") << QByteArray("spinBox_column");
|
|
|
|
|
|
|
|
QTest::newRow("Frame:TextInput") << QByteArray("container_frame") << QByteArray("textInput_frame") << QByteArray("container_frame");
|
|
|
|
QTest::newRow("Frame:TextEdit") << QByteArray("container_frame") << QByteArray("textEdit_frame") << QByteArray("container_frame");
|
|
|
|
QTest::newRow("Frame:TextField") << QByteArray("container_frame") << QByteArray("textField_frame") << QByteArray("textField_frame");
|
|
|
|
QTest::newRow("Frame:TextArea") << QByteArray("container_frame") << QByteArray("textArea_frame") << QByteArray("textArea_frame");
|
|
|
|
QTest::newRow("Frame:SpinBox") << QByteArray("container_frame") << QByteArray("spinContent_frame") << QByteArray("spinBox_frame");
|
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::activeFocusControl()
|
2015-11-29 20:56:36 +00:00
|
|
|
{
|
|
|
|
QFETCH(QByteArray, containerName);
|
|
|
|
QFETCH(QByteArray, activeFocusItemName);
|
|
|
|
QFETCH(QByteArray, activeFocusControlName);
|
|
|
|
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("activeFocusControl.qml"));
|
|
|
|
QScopedPointer<QObject> object(component.create());
|
|
|
|
QVERIFY(!object.isNull());
|
|
|
|
|
|
|
|
QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(object.data());
|
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(!window->isVisible());
|
|
|
|
QCOMPARE(window->width(), 400);
|
|
|
|
QCOMPARE(window->height(), 400);
|
|
|
|
|
|
|
|
window->show();
|
2024-08-20 10:59:35 +00:00
|
|
|
window->requestActivate();
|
2015-11-29 20:56:36 +00:00
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
|
|
|
|
QQuickItem *container = window->property(containerName).value<QQuickItem*>();
|
|
|
|
QVERIFY(container);
|
|
|
|
|
|
|
|
QQuickItem *activeFocusItem = window->property(activeFocusItemName).value<QQuickItem*>();
|
|
|
|
QVERIFY(activeFocusItem);
|
|
|
|
activeFocusItem->forceActiveFocus();
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(activeFocusItem);
|
2015-11-29 20:56:36 +00:00
|
|
|
QCOMPARE(window->activeFocusItem(), activeFocusItem);
|
|
|
|
|
|
|
|
QQuickItem *activeFocusControl = window->property(activeFocusControlName).value<QQuickItem*>();
|
|
|
|
if (activeFocusControlName.isEmpty()) {
|
|
|
|
QVERIFY(!activeFocusControl);
|
|
|
|
} else {
|
|
|
|
QVERIFY(activeFocusControl);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(activeFocusControl);
|
2015-11-29 20:56:36 +00:00
|
|
|
}
|
|
|
|
QCOMPARE(window->activeFocusControl(), activeFocusControl);
|
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::focusAfterPopupClosed()
|
2016-05-10 10:44:15 +00:00
|
|
|
{
|
2022-04-14 16:00:56 +00:00
|
|
|
#ifdef Q_OS_ANDROID
|
|
|
|
QSKIP("This test crashes in Android emulator because of GLES issues (QTBUG-100991)");
|
|
|
|
#endif
|
2016-05-10 10:44:15 +00:00
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("focusAfterPopupClosed.qml"));
|
|
|
|
QScopedPointer<QQuickWindow> window(qobject_cast<QQuickWindow*>(component.create()));
|
|
|
|
QVERIFY(window);
|
|
|
|
|
|
|
|
window->show();
|
|
|
|
window->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window.data()));
|
|
|
|
QVERIFY(QGuiApplication::focusWindow() == window.data());
|
|
|
|
|
|
|
|
QQuickItem* contentItem = window->contentItem();
|
|
|
|
QVERIFY(contentItem);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(contentItem);
|
2016-05-10 10:44:15 +00:00
|
|
|
|
|
|
|
QQuickItem* focusScope = window->property("focusScope").value<QQuickItem*>();
|
|
|
|
QVERIFY(focusScope);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(focusScope);
|
2016-05-10 10:44:15 +00:00
|
|
|
|
2017-07-10 14:48:07 +00:00
|
|
|
QSignalSpy focusScopeSpy(window.data(), SIGNAL(focusScopeKeyPressed()));
|
2016-05-10 10:44:15 +00:00
|
|
|
QTest::keyClick(window.data(), Qt::Key_Space);
|
2022-10-05 05:29:16 +00:00
|
|
|
QCOMPARE(focusScopeSpy.size(), 1);
|
2016-05-10 10:44:15 +00:00
|
|
|
|
|
|
|
// Open the menu.
|
|
|
|
QQuickItem* toolButton = window->property("toolButton").value<QQuickItem*>();
|
|
|
|
QVERIFY(toolButton);
|
|
|
|
QTest::mouseClick(window.data(), Qt::LeftButton, Qt::NoModifier,
|
|
|
|
toolButton->mapFromScene(QPointF(toolButton->width() / 2, toolButton->height() / 2)).toPoint());
|
|
|
|
QVERIFY(!focusScope->hasActiveFocus());
|
|
|
|
|
|
|
|
// The FocusScope shouldn't receive any key events while the menu is open.
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Space);
|
2022-10-05 05:29:16 +00:00
|
|
|
QCOMPARE(focusScopeSpy.size(), 1);
|
2016-05-10 10:44:15 +00:00
|
|
|
|
|
|
|
// Close the menu. The FocusScope should regain focus.
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Escape);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(focusScope);
|
2016-05-10 10:44:15 +00:00
|
|
|
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Space);
|
2022-10-05 05:29:16 +00:00
|
|
|
QCOMPARE(focusScopeSpy.size(), 2);
|
2017-07-10 14:48:07 +00:00
|
|
|
|
|
|
|
QQuickPopup *focusPopup = window->property("focusPopup").value<QQuickPopup*>();
|
|
|
|
QVERIFY(focusPopup);
|
|
|
|
QVERIFY(!focusPopup->hasActiveFocus());
|
|
|
|
|
|
|
|
focusPopup->open();
|
|
|
|
QVERIFY(focusPopup->isVisible());
|
|
|
|
|
|
|
|
QSignalSpy focusPopupSpy(window.data(), SIGNAL(focusPopupKeyPressed()));
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Space);
|
2022-10-05 05:29:16 +00:00
|
|
|
QCOMPARE(focusPopupSpy.size(), 1);
|
2017-07-10 14:48:07 +00:00
|
|
|
|
|
|
|
QQuickMenu *fileMenu = window->property("fileMenu").value<QQuickMenu*>();
|
|
|
|
QVERIFY(fileMenu);
|
|
|
|
fileMenu->open();
|
|
|
|
QVERIFY(fileMenu->isVisible());
|
|
|
|
|
|
|
|
// The Popup shouldn't receive any key events while the menu is open.
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Space);
|
2022-10-05 05:29:16 +00:00
|
|
|
QCOMPARE(focusPopupSpy.size(), 1);
|
2017-07-10 14:48:07 +00:00
|
|
|
|
|
|
|
// Close the menu. The Popup should regain focus.
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Escape);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(focusPopup);
|
2017-07-10 14:48:07 +00:00
|
|
|
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Space);
|
2022-10-05 05:29:16 +00:00
|
|
|
QCOMPARE(focusPopupSpy.size(), 2);
|
2017-07-10 14:48:07 +00:00
|
|
|
|
|
|
|
// Close the popup. The FocusScope should regain focus.
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Escape);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(focusScope);
|
2017-07-10 14:48:07 +00:00
|
|
|
|
|
|
|
QTest::keyClick(window.data(), Qt::Key_Space);
|
2022-10-05 05:29:16 +00:00
|
|
|
QCOMPARE(focusScopeSpy.size(), 3);
|
2016-05-10 10:44:15 +00:00
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::clearFocusOnDestruction()
|
2017-01-03 12:46:46 +00:00
|
|
|
{
|
2020-09-04 08:38:35 +00:00
|
|
|
if (!canImportModule("import QtGraphicalEffects; DropShadow {}"))
|
2020-05-12 11:46:06 +00:00
|
|
|
QSKIP("Test requires QtGraphicalEffects");
|
|
|
|
|
2017-01-03 12:46:46 +00:00
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("clearfocusondestruction.qml"));
|
|
|
|
QScopedPointer<QQuickWindow> window(qobject_cast<QQuickWindow*>(component.create()));
|
|
|
|
QVERIFY(window);
|
|
|
|
|
|
|
|
window->show();
|
|
|
|
window->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window.data()));
|
|
|
|
QVERIFY(QGuiApplication::focusWindow() == window.data());
|
|
|
|
|
|
|
|
QQuickItem* contentItem = window->contentItem();
|
|
|
|
QVERIFY(contentItem);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(contentItem);
|
2017-01-03 12:46:46 +00:00
|
|
|
|
|
|
|
QQuickItem* focusScope = window->property("textfield").value<QQuickItem*>();
|
|
|
|
QVERIFY(focusScope);
|
2025-02-24 07:30:38 +00:00
|
|
|
QVERIFY_ACTIVE_FOCUS(focusScope);
|
2017-01-03 12:46:46 +00:00
|
|
|
|
|
|
|
QSignalSpy spy(window.data(), SIGNAL(activeFocusControlChanged()));
|
|
|
|
// destroy the window, do not crash
|
|
|
|
window.reset();
|
|
|
|
|
|
|
|
/*
|
|
|
|
QQuickWindow::activeFocusItemChanged() is emitted inconsistently and
|
|
|
|
only for certain use cases. Ideally it should be emitted whenever a
|
|
|
|
QQuickWindow with a focus item is destroyed, but it doesn't... It might
|
|
|
|
also be favorable to not emit it for performance reason.
|
|
|
|
|
|
|
|
However, activeFocusControlChanged() is emitted more consistently, which
|
|
|
|
of course makes it inconsistent with the emission of
|
|
|
|
activeFocusItemChanged()....
|
|
|
|
|
|
|
|
Therefore, if you have good reasons to change the behavior (and not emit
|
|
|
|
it) take the test below with a grain of salt.
|
|
|
|
*/
|
2022-10-05 05:29:16 +00:00
|
|
|
QCOMPARE(spy.size(), 1);
|
2017-01-03 12:46:46 +00:00
|
|
|
}
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::layout()
|
2016-08-08 18:50:13 +00:00
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("layout.qml"));
|
|
|
|
QScopedPointer<QObject> object(component.create());
|
|
|
|
QVERIFY(!object.isNull());
|
|
|
|
|
|
|
|
QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(object.data());
|
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(QTest::qWaitForWindowExposed(window));
|
|
|
|
|
|
|
|
QQuickItem *content = window->contentItem();
|
|
|
|
QVERIFY(content);
|
2017-08-30 09:28:17 +00:00
|
|
|
QQuickItem *menuBar = window->menuBar();
|
|
|
|
QVERIFY(menuBar);
|
2016-08-08 18:50:13 +00:00
|
|
|
QQuickItem *header = window->header();
|
|
|
|
QVERIFY(header);
|
|
|
|
QQuickItem *footer = window->footer();
|
|
|
|
QVERIFY(footer);
|
|
|
|
|
2017-08-30 09:28:17 +00:00
|
|
|
QCOMPARE(menuBar->x(), 0.0);
|
Teach ApplicationWindow about safe area margins
If the window has non-safe areas, as reflected by the window's
safe area margins, ApplicationWindow will now automatically
pad the content item accordingly, ensuring that the content
item is within the safe area of the window.
To implement this we piggy-back on QQuickControl, letting
the control manage the size and position of the content
item. This allows us to use the built in padding of
QQuickControl to inset the content.
Internally the item hierarchy of ApplicationWindow no
longer represents the header, footer, and menu bar as
children of the ApplicationWindow's content item, but
rather as sibling items in the QQuickWindow content item,
similar to the window's background item.
Doing this is a slight behavior change, but for something
that should have been an implementation detail as far as
users are concerned.
The content control and header, footer and menu bar now all
live within the same root QQuickWindow::contentItem, which
is a focus scope on its own.
End users can override the automatic padding that we do
for the contentItem by setting any of the four new padding
properties that we expose, mirroring the properties on
QQuickControl.
[ChangeLog][Important Behavior Changes] The contentItem
of ApplicationWindow is now automatically padded to
account for safe area margins. To override the automatic
padding, set the padding explicitly, via e.g.
`topPadding: 0`.
Task-number: QTBUG-125373
Change-Id: I986e425a7f316db244c7fc86283b8b333978e3ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-17 14:35:26 +00:00
|
|
|
QCOMPARE(menuBar->y(), 0.0);
|
|
|
|
QCOMPARE(menuBar->width(), qreal(window->width()));
|
2017-08-30 09:28:17 +00:00
|
|
|
QVERIFY(menuBar->height() > 0);
|
|
|
|
|
2016-08-08 18:50:13 +00:00
|
|
|
QCOMPARE(header->x(), 0.0);
|
Teach ApplicationWindow about safe area margins
If the window has non-safe areas, as reflected by the window's
safe area margins, ApplicationWindow will now automatically
pad the content item accordingly, ensuring that the content
item is within the safe area of the window.
To implement this we piggy-back on QQuickControl, letting
the control manage the size and position of the content
item. This allows us to use the built in padding of
QQuickControl to inset the content.
Internally the item hierarchy of ApplicationWindow no
longer represents the header, footer, and menu bar as
children of the ApplicationWindow's content item, but
rather as sibling items in the QQuickWindow content item,
similar to the window's background item.
Doing this is a slight behavior change, but for something
that should have been an implementation detail as far as
users are concerned.
The content control and header, footer and menu bar now all
live within the same root QQuickWindow::contentItem, which
is a focus scope on its own.
End users can override the automatic padding that we do
for the contentItem by setting any of the four new padding
properties that we expose, mirroring the properties on
QQuickControl.
[ChangeLog][Important Behavior Changes] The contentItem
of ApplicationWindow is now automatically padded to
account for safe area margins. To override the automatic
padding, set the padding explicitly, via e.g.
`topPadding: 0`.
Task-number: QTBUG-125373
Change-Id: I986e425a7f316db244c7fc86283b8b333978e3ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-17 14:35:26 +00:00
|
|
|
QCOMPARE(header->y(), menuBar->height());
|
2016-08-08 18:50:13 +00:00
|
|
|
QCOMPARE(header->width(), qreal(window->width()));
|
|
|
|
QVERIFY(header->height() > 0);
|
|
|
|
|
|
|
|
QCOMPARE(footer->x(), 0.0);
|
Teach ApplicationWindow about safe area margins
If the window has non-safe areas, as reflected by the window's
safe area margins, ApplicationWindow will now automatically
pad the content item accordingly, ensuring that the content
item is within the safe area of the window.
To implement this we piggy-back on QQuickControl, letting
the control manage the size and position of the content
item. This allows us to use the built in padding of
QQuickControl to inset the content.
Internally the item hierarchy of ApplicationWindow no
longer represents the header, footer, and menu bar as
children of the ApplicationWindow's content item, but
rather as sibling items in the QQuickWindow content item,
similar to the window's background item.
Doing this is a slight behavior change, but for something
that should have been an implementation detail as far as
users are concerned.
The content control and header, footer and menu bar now all
live within the same root QQuickWindow::contentItem, which
is a focus scope on its own.
End users can override the automatic padding that we do
for the contentItem by setting any of the four new padding
properties that we expose, mirroring the properties on
QQuickControl.
[ChangeLog][Important Behavior Changes] The contentItem
of ApplicationWindow is now automatically padded to
account for safe area margins. To override the automatic
padding, set the padding explicitly, via e.g.
`topPadding: 0`.
Task-number: QTBUG-125373
Change-Id: I986e425a7f316db244c7fc86283b8b333978e3ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-17 14:35:26 +00:00
|
|
|
QCOMPARE(footer->y(), window->height() - footer->height());
|
2016-08-08 18:50:13 +00:00
|
|
|
QCOMPARE(footer->width(), qreal(window->width()));
|
|
|
|
QVERIFY(footer->height() > 0.0);
|
|
|
|
|
2017-08-30 09:28:17 +00:00
|
|
|
QCOMPARE(content->x(), 0.0);
|
|
|
|
QCOMPARE(content->y(), menuBar->height() + header->height());
|
|
|
|
QCOMPARE(content->width(), qreal(window->width()));
|
|
|
|
QCOMPARE(content->height(), window->height() - menuBar->height() - header->height() - footer->height());
|
|
|
|
|
|
|
|
menuBar->setVisible(false);
|
2016-08-08 18:50:13 +00:00
|
|
|
QCOMPARE(content->x(), 0.0);
|
|
|
|
QCOMPARE(content->y(), header->height());
|
|
|
|
QCOMPARE(content->width(), qreal(window->width()));
|
|
|
|
QCOMPARE(content->height(), window->height() - header->height() - footer->height());
|
|
|
|
|
|
|
|
header->setVisible(false);
|
|
|
|
QCOMPARE(content->x(), 0.0);
|
|
|
|
QCOMPARE(content->y(), 0.0);
|
|
|
|
QCOMPARE(content->width(), qreal(window->width()));
|
|
|
|
QCOMPARE(content->height(), window->height() - footer->height());
|
|
|
|
|
|
|
|
footer->setVisible(false);
|
|
|
|
QCOMPARE(content->x(), 0.0);
|
|
|
|
QCOMPARE(content->y(), 0.0);
|
|
|
|
QCOMPARE(content->width(), qreal(window->width()));
|
|
|
|
QCOMPARE(content->height(), qreal(window->height()));
|
|
|
|
}
|
|
|
|
|
2021-06-11 14:31:30 +00:00
|
|
|
void tst_QQuickApplicationWindow::layoutLayout()
|
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("layoutLayout.qml"));
|
|
|
|
QScopedPointer<QObject> object(component.create());
|
|
|
|
QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
|
|
|
|
|
|
|
|
QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(object.data());
|
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(QTest::qWaitForWindowExposed(window));
|
|
|
|
|
|
|
|
QQuickItem *content = window->contentItem();
|
|
|
|
QVERIFY(content);
|
|
|
|
QQuickItem *header = window->header();
|
|
|
|
QVERIFY(header);
|
|
|
|
QQuickItem *footer = window->footer();
|
|
|
|
QVERIFY(footer);
|
|
|
|
|
|
|
|
QQuickItem *headerChild = header->findChild<QQuickItem*>();
|
|
|
|
QVERIFY(headerChild);
|
|
|
|
QCOMPARE(header->x(), 0.0);
|
Teach ApplicationWindow about safe area margins
If the window has non-safe areas, as reflected by the window's
safe area margins, ApplicationWindow will now automatically
pad the content item accordingly, ensuring that the content
item is within the safe area of the window.
To implement this we piggy-back on QQuickControl, letting
the control manage the size and position of the content
item. This allows us to use the built in padding of
QQuickControl to inset the content.
Internally the item hierarchy of ApplicationWindow no
longer represents the header, footer, and menu bar as
children of the ApplicationWindow's content item, but
rather as sibling items in the QQuickWindow content item,
similar to the window's background item.
Doing this is a slight behavior change, but for something
that should have been an implementation detail as far as
users are concerned.
The content control and header, footer and menu bar now all
live within the same root QQuickWindow::contentItem, which
is a focus scope on its own.
End users can override the automatic padding that we do
for the contentItem by setting any of the four new padding
properties that we expose, mirroring the properties on
QQuickControl.
[ChangeLog][Important Behavior Changes] The contentItem
of ApplicationWindow is now automatically padded to
account for safe area margins. To override the automatic
padding, set the padding explicitly, via e.g.
`topPadding: 0`.
Task-number: QTBUG-125373
Change-Id: I986e425a7f316db244c7fc86283b8b333978e3ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-17 14:35:26 +00:00
|
|
|
QCOMPARE(header->y(), 0.0);
|
2021-06-11 14:31:30 +00:00
|
|
|
QCOMPARE(header->width(), qreal(window->width()));
|
|
|
|
QCOMPARE(headerChild->width(), qreal(window->width()));
|
|
|
|
QVERIFY(header->height() > 0);
|
|
|
|
|
2025-05-26 06:27:22 +00:00
|
|
|
QQuickItem *footerChild = footer->findChild<QQuickItem*>();
|
2021-06-11 14:31:30 +00:00
|
|
|
QVERIFY(footerChild);
|
|
|
|
QCOMPARE(footer->x(), 0.0);
|
Teach ApplicationWindow about safe area margins
If the window has non-safe areas, as reflected by the window's
safe area margins, ApplicationWindow will now automatically
pad the content item accordingly, ensuring that the content
item is within the safe area of the window.
To implement this we piggy-back on QQuickControl, letting
the control manage the size and position of the content
item. This allows us to use the built in padding of
QQuickControl to inset the content.
Internally the item hierarchy of ApplicationWindow no
longer represents the header, footer, and menu bar as
children of the ApplicationWindow's content item, but
rather as sibling items in the QQuickWindow content item,
similar to the window's background item.
Doing this is a slight behavior change, but for something
that should have been an implementation detail as far as
users are concerned.
The content control and header, footer and menu bar now all
live within the same root QQuickWindow::contentItem, which
is a focus scope on its own.
End users can override the automatic padding that we do
for the contentItem by setting any of the four new padding
properties that we expose, mirroring the properties on
QQuickControl.
[ChangeLog][Important Behavior Changes] The contentItem
of ApplicationWindow is now automatically padded to
account for safe area margins. To override the automatic
padding, set the padding explicitly, via e.g.
`topPadding: 0`.
Task-number: QTBUG-125373
Change-Id: I986e425a7f316db244c7fc86283b8b333978e3ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-17 14:35:26 +00:00
|
|
|
QCOMPARE(footer->y(), window->height() - footer->height());
|
2021-06-11 14:31:30 +00:00
|
|
|
QCOMPARE(footer->width(), qreal(window->width()));
|
|
|
|
QCOMPARE(footerChild->width(), qreal(window->width()));
|
|
|
|
QVERIFY(footer->height() > 0.0);
|
|
|
|
}
|
|
|
|
|
2017-04-21 05:45:13 +00:00
|
|
|
class FriendlyApplicationWindow : public QQuickApplicationWindow
|
|
|
|
{
|
2017-09-27 12:48:17 +00:00
|
|
|
friend class tst_QQuickApplicationWindow;
|
2017-04-21 05:45:13 +00:00
|
|
|
};
|
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
void tst_QQuickApplicationWindow::componentComplete()
|
2017-04-21 05:45:13 +00:00
|
|
|
{
|
|
|
|
FriendlyApplicationWindow cppWindow;
|
|
|
|
QVERIFY(cppWindow.isComponentComplete());
|
|
|
|
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
2020-09-04 08:38:35 +00:00
|
|
|
component.setData("import QtQuick.Controls; ApplicationWindow { }", QUrl());
|
2017-04-21 05:45:13 +00:00
|
|
|
|
|
|
|
FriendlyApplicationWindow *qmlWindow = static_cast<FriendlyApplicationWindow *>(component.beginCreate(engine.rootContext()));
|
|
|
|
QVERIFY(qmlWindow);
|
|
|
|
QVERIFY(!qmlWindow->isComponentComplete());
|
|
|
|
|
|
|
|
component.completeCreate();
|
|
|
|
QVERIFY(qmlWindow->isComponentComplete());
|
|
|
|
}
|
|
|
|
|
2020-03-27 10:17:35 +00:00
|
|
|
void tst_QQuickApplicationWindow::opacity()
|
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("opacity.qml"));
|
|
|
|
|
|
|
|
QScopedPointer<QObject> object(component.create());
|
|
|
|
QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
|
|
|
|
|
|
|
|
QQuickApplicationWindow *window = qobject_cast<QQuickApplicationWindow *>(object.data());
|
|
|
|
QVERIFY(window);
|
|
|
|
}
|
|
|
|
|
2024-03-11 05:03:30 +00:00
|
|
|
void tst_QQuickApplicationWindow::backgroundSize()
|
|
|
|
{
|
|
|
|
QQuickControlsApplicationHelper helper(this, QLatin1String("backgroundSize.qml"));
|
|
|
|
QVERIFY2(helper.ready, helper.failureMessage());
|
|
|
|
QQuickApplicationWindow *window = helper.appWindow;
|
|
|
|
QCOMPARE(window->width(), 600);
|
|
|
|
QCOMPARE(window->height(), 400);
|
|
|
|
|
|
|
|
auto *background = window->background();
|
|
|
|
QCOMPARE(background->implicitWidth(), 123);
|
|
|
|
QCOMPARE(background->implicitHeight(), 456);
|
|
|
|
QCOMPARE(background->width(), window->width());
|
|
|
|
QCOMPARE(background->height(), window->height());
|
|
|
|
|
|
|
|
// Changing the implicit size of the background shouldn't have any effect
|
|
|
|
// on its size if it was never explicitly set.
|
|
|
|
background->setImplicitWidth(234);
|
|
|
|
QCOMPARE(background->implicitWidth(), 234);
|
|
|
|
QCOMPARE(window->width(), 600);
|
|
|
|
QCOMPARE(background->width(), window->width());
|
|
|
|
|
|
|
|
background->setImplicitHeight(567);
|
|
|
|
QCOMPARE(background->implicitHeight(), 567);
|
|
|
|
QCOMPARE(window->height(), 400);
|
|
|
|
QCOMPARE(background->height(), window->height());
|
|
|
|
|
|
|
|
// Explicitly setting the size of the background should ensure
|
|
|
|
// that it's respected from that point onwards.
|
|
|
|
background->setWidth(345);
|
|
|
|
QCOMPARE(background->implicitWidth(), 234);
|
|
|
|
QCOMPARE(window->width(), 600);
|
|
|
|
QCOMPARE(background->width(), 345);
|
|
|
|
|
|
|
|
window->setWidth(610);
|
|
|
|
QCOMPARE(background->width(), 345);
|
|
|
|
|
|
|
|
background->setHeight(678);
|
|
|
|
QCOMPARE(background->implicitHeight(), 567);
|
|
|
|
QCOMPARE(window->height(), 400);
|
|
|
|
QCOMPARE(background->height(), 678);
|
|
|
|
|
|
|
|
window->setHeight(410);
|
|
|
|
QCOMPARE(background->height(), 678);
|
|
|
|
}
|
|
|
|
|
2024-04-26 02:41:38 +00:00
|
|
|
void tst_QQuickApplicationWindow::explicitBackgroundSizeBinding()
|
|
|
|
{
|
|
|
|
QQuickControlsApplicationHelper helper(this, QLatin1String("explicitBackgroundSizeBinding.qml"));
|
|
|
|
QVERIFY2(helper.ready, helper.failureMessage());
|
|
|
|
QQuickApplicationWindow *window = helper.appWindow;
|
|
|
|
window->show();
|
2024-08-20 10:59:35 +00:00
|
|
|
window->requestActivate();
|
2024-04-26 02:41:38 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
Teach ApplicationWindow about safe area margins
If the window has non-safe areas, as reflected by the window's
safe area margins, ApplicationWindow will now automatically
pad the content item accordingly, ensuring that the content
item is within the safe area of the window.
To implement this we piggy-back on QQuickControl, letting
the control manage the size and position of the content
item. This allows us to use the built in padding of
QQuickControl to inset the content.
Internally the item hierarchy of ApplicationWindow no
longer represents the header, footer, and menu bar as
children of the ApplicationWindow's content item, but
rather as sibling items in the QQuickWindow content item,
similar to the window's background item.
Doing this is a slight behavior change, but for something
that should have been an implementation detail as far as
users are concerned.
The content control and header, footer and menu bar now all
live within the same root QQuickWindow::contentItem, which
is a focus scope on its own.
End users can override the automatic padding that we do
for the contentItem by setting any of the four new padding
properties that we expose, mirroring the properties on
QQuickControl.
[ChangeLog][Important Behavior Changes] The contentItem
of ApplicationWindow is now automatically padded to
account for safe area margins. To override the automatic
padding, set the padding explicitly, via e.g.
`topPadding: 0`.
Task-number: QTBUG-125373
Change-Id: I986e425a7f316db244c7fc86283b8b333978e3ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-17 14:35:26 +00:00
|
|
|
void tst_QQuickApplicationWindow::safeArea()
|
|
|
|
{
|
|
|
|
QQuickControlsApplicationHelper helper(this, QLatin1String("safeArea.qml"));
|
|
|
|
QVERIFY2(helper.ready, helper.failureMessage());
|
|
|
|
QQuickApplicationWindow *window = helper.appWindow;
|
|
|
|
window->show();
|
|
|
|
window->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowExposed(window));
|
|
|
|
|
|
|
|
auto menuBarRect = window->menuBar()->mapRectToScene(window->menuBar()->boundingRect());
|
|
|
|
auto headerRect = window->header()->mapRectToScene(window->header()->boundingRect());
|
|
|
|
auto contentRect = window->contentItem()->mapRectToScene(window->contentItem()->boundingRect());
|
|
|
|
auto footerRect = window->footer()->mapRectToScene(window->footer()->boundingRect());
|
|
|
|
|
|
|
|
// No item should overlap by default when there are no margins
|
|
|
|
QCOMPARE(menuBarRect.intersected(headerRect), QRectF());
|
|
|
|
QCOMPARE(menuBarRect.intersected(contentRect), QRectF());
|
|
|
|
QCOMPARE(menuBarRect.intersected(footerRect), QRectF());
|
|
|
|
QCOMPARE(headerRect.intersected(contentRect), QRectF());
|
|
|
|
QCOMPARE(headerRect.intersected(footerRect), QRectF());
|
|
|
|
QCOMPARE(footerRect.intersected(contentRect), QRectF());
|
|
|
|
|
|
|
|
// And content item should not report any safe area margins
|
|
|
|
auto *contentSafeArea = qobject_cast<QQuickSafeArea*>(
|
|
|
|
qmlAttachedPropertiesObject<QQuickSafeArea>(window->contentItem()));
|
|
|
|
QCOMPARE(contentSafeArea->margins(), QMarginsF());
|
|
|
|
|
|
|
|
auto *windowSafeArea = qobject_cast<QQuickSafeArea*>(
|
|
|
|
qmlAttachedPropertiesObject<QQuickSafeArea>(window));
|
|
|
|
windowSafeArea->setAdditionalMargins(QMarginsF(100, 100, 100, 100));
|
|
|
|
|
|
|
|
QTRY_COMPARE(window->property("margins").value<QMarginsF>(),
|
|
|
|
windowSafeArea->additionalMargins());
|
|
|
|
|
|
|
|
menuBarRect = window->menuBar()->mapRectToScene(window->menuBar()->boundingRect());
|
|
|
|
headerRect = window->header()->mapRectToScene(window->header()->boundingRect());
|
|
|
|
contentRect = window->contentItem()->mapRectToScene(window->contentItem()->boundingRect());
|
|
|
|
footerRect = window->footer()->mapRectToScene(window->footer()->boundingRect());
|
|
|
|
|
|
|
|
// No item should overlap by default when there are margins
|
|
|
|
QCOMPARE(menuBarRect.intersected(headerRect), QRectF());
|
|
|
|
QCOMPARE(menuBarRect.intersected(contentRect), QRectF());
|
|
|
|
QCOMPARE(menuBarRect.intersected(footerRect), QRectF());
|
|
|
|
QCOMPARE(headerRect.intersected(contentRect), QRectF());
|
|
|
|
QCOMPARE(headerRect.intersected(footerRect), QRectF());
|
|
|
|
QCOMPARE(footerRect.intersected(contentRect), QRectF());
|
|
|
|
|
|
|
|
// And content item should not report any safe area margins
|
|
|
|
QCOMPARE(contentSafeArea->margins(), QMarginsF());
|
|
|
|
|
|
|
|
QQmlProperty::write(window, "leftPadding", 0);
|
|
|
|
QQmlProperty::write(window, "topPadding", 0);
|
|
|
|
QQmlProperty::write(window, "rightPadding", 0);
|
|
|
|
QQmlProperty::write(window, "bottomPadding", 0);
|
|
|
|
|
|
|
|
// Removing the automatic padding should reflect the window's safe area margins
|
|
|
|
QCOMPARE(contentSafeArea->margins(), windowSafeArea->additionalMargins());
|
|
|
|
|
|
|
|
// And the content item should fill the entire window
|
|
|
|
QCOMPARE(window->contentItem()->position(), QPoint());
|
|
|
|
QCOMPARE(window->contentItem()->size(), window->size());
|
|
|
|
|
|
|
|
// Having no window safe area marings should still reflect the
|
|
|
|
// menuBar, header, and footer as safe areas
|
|
|
|
windowSafeArea->setAdditionalMargins(QMarginsF());
|
|
|
|
QTRY_COMPARE(window->property("margins").value<QMarginsF>(),
|
|
|
|
windowSafeArea->additionalMargins());
|
|
|
|
|
|
|
|
QCOMPARE(contentSafeArea->margins(),
|
|
|
|
QMarginsF(0, window->menuBar()->height() + window->header()->height(),
|
|
|
|
0, window->footer()->height()));
|
|
|
|
|
|
|
|
// And the content item still should fill the entire window
|
|
|
|
QCOMPARE(window->contentItem()->position(), QPoint());
|
|
|
|
QCOMPARE(window->contentItem()->size(), window->size());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2025-06-26 09:26:43 +00:00
|
|
|
void tst_QQuickApplicationWindow::paintOrderChildItems()
|
|
|
|
{
|
|
|
|
QQmlEngine engine;
|
|
|
|
QQmlComponent component(&engine);
|
|
|
|
component.loadUrl(testFileUrl("activefocusontab.qml"));
|
|
|
|
QObject *created = component.create();
|
|
|
|
QScopedPointer<QObject> cleanup(created);
|
|
|
|
QVERIFY(created);
|
|
|
|
|
|
|
|
QQuickWindow *window = qobject_cast<QQuickWindow *>(created);
|
|
|
|
QVERIFY(window);
|
|
|
|
window->show();
|
|
|
|
window->requestActivate();
|
|
|
|
QVERIFY(QTest::qWaitForWindowActive(window));
|
|
|
|
|
|
|
|
const auto &paintOrder = QQuickItemPrivate::get(window->contentItem())->paintOrderChildItems();
|
|
|
|
for (const auto &child : paintOrder) {
|
|
|
|
if (child == window->contentItem())
|
|
|
|
QVERIFY(child->z() == 0);
|
|
|
|
else if (child == qobject_cast<QQuickApplicationWindow *>(window)->menuBar())
|
|
|
|
QVERIFY(child->z() == 2);
|
|
|
|
else if (child == qobject_cast<QQuickApplicationWindow *>(window)->header())
|
|
|
|
QVERIFY(child->z() == 1);
|
|
|
|
else if (child == qobject_cast<QQuickApplicationWindow *>(window)->footer())
|
|
|
|
QVERIFY(child->z() == 1);
|
|
|
|
else if (child == qobject_cast<QQuickApplicationWindow *>(window)->background())
|
|
|
|
QVERIFY(child->z() == -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-04-25 07:25:25 +00:00
|
|
|
#if QT_CONFIG(quicktemplates2_hover)
|
2025-04-17 02:34:11 +00:00
|
|
|
void tst_QQuickApplicationWindow::hoverInBackground()
|
|
|
|
{
|
|
|
|
QQuickControlsApplicationHelper helper(this, QLatin1String("hoverInBackground.qml"));
|
|
|
|
QVERIFY2(helper.ready, helper.failureMessage());
|
|
|
|
QQuickApplicationWindow *window = helper.appWindow;
|
|
|
|
window->show();
|
|
|
|
QVERIFY(QTest::qWaitForWindowExposed(window));
|
|
|
|
|
|
|
|
auto *mouseArea = window->findChild<QQuickMouseArea *>();
|
|
|
|
QVERIFY(mouseArea);
|
|
|
|
const QPoint windowCenter = mapCenterToWindow(window->contentItem());
|
|
|
|
PointLerper pointLerper(window, windowCenter - QPoint(100, 100));
|
|
|
|
pointLerper.move(windowCenter, 2);
|
|
|
|
QVERIFY(mouseArea->hovered());
|
|
|
|
|
|
|
|
auto *button = window->findChild<QQuickAbstractButton *>();
|
|
|
|
QVERIFY(button);
|
|
|
|
pointLerper.move(mapCenterToWindow(button), 2);
|
|
|
|
QCOMPARE(button->isHovered(), QQuickControlPrivate::calcHoverEnabled(window->contentItem()));
|
|
|
|
}
|
2025-04-25 07:25:25 +00:00
|
|
|
#endif // QT_CONFIG(quicktemplates2_hover)
|
2025-04-17 02:34:11 +00:00
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
QTEST_MAIN(tst_QQuickApplicationWindow)
|
2015-07-20 15:27:05 +00:00
|
|
|
|
2017-09-27 12:48:17 +00:00
|
|
|
#include "tst_qquickapplicationwindow.moc"
|