Resize window to content
Unsolved
QML and Qt Quick
-
Is there any easy way to automatically adjust the window size to fit the content (text, it's a message dialog)?
-
ApplicationWindow performs auto resize to fit their children
import QtQuick 2.11 import QtQuick.Controls 1.4 ApplicationWindow { id: window visible: true title: "My Window Title" Rectangle{ id: rect1 color: "#ff00ff" width:360; height: 50 } Rectangle{ id: rect2 color: "#ff0000" anchors {top: rect1.bottom; left: rect1.left} width: 280; height: 280 } Rectangle{ id: rect3 color: "#ffff00" anchors {left: rect2.right; top: rect1.bottom} width: 120; height: 150 } }