diff --git a/src/controls/src/application_p.cpp b/src/controls/src/application_p.cpp index b329c82..0fb191b 100644 --- a/src/controls/src/application_p.cpp +++ b/src/controls/src/application_p.cpp @@ -51,3 +51,20 @@ bool Application_p::overridesSystemGestures() { return m_overridesSystemGestures; } + +void Application_p::itemChange(ItemChange change, const ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + if (change == ItemSceneChange && data.window) { + auto syncSize = [this]() { + QQuickWindow *w = window(); + if (w && w->width() > 0) { + setWidth(w->width()); + setHeight(w->height()); + } + }; + syncSize(); + connect(data.window, &QQuickWindow::widthChanged, this, syncSize); + connect(data.window, &QQuickWindow::heightChanged, this, syncSize); + } +} diff --git a/src/controls/src/application_p.h b/src/controls/src/application_p.h index 414db5a..1cfede6 100644 --- a/src/controls/src/application_p.h +++ b/src/controls/src/application_p.h @@ -47,6 +47,9 @@ class Application_p : public QQuickItem private: bool m_overridesSystemGestures; +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + signals: void overridesSystemGesturesChanged(); };