Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/controls/src/application_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
3 changes: 3 additions & 0 deletions src/controls/src/application_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
Expand Down