Doc: update reusing qml example

Make UI visible on Qt Creator.Also use id instead of parent.

Fixes: QTBUG-107030
Pick-to: 6.8 6.9
Change-Id: Ia856d214d3548e78c3b10a3e0b5e76d143986c7d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Semih Yavuz 2025-02-18 18:01:42 +01:00
parent 1f9d0b6267
commit 7630d832ee
1 changed files with 23 additions and 20 deletions

View File

@ -3,28 +3,31 @@
//![0] //![0]
// application.qml // application.qml
import QtQuick import QtQuick
Window {
Column { id: root
width: 180 width: 180
height: 180 height: 180
visible: true
Column {
anchors.fill: parent
padding: 1.5 padding: 1.5
topPadding: 10.0 topPadding: 10.0
bottomPadding: 10.0 bottomPadding: 10.0
spacing: 5 spacing: 5
MessageLabel{ MessageLabel{
width: parent.width - 2 width: root.width - 2
msgType: "debug" msgType: "debug"
} }
MessageLabel { MessageLabel {
width: parent.width - 2 width: root.width - 2
message: "This is a warning!" message: "This is a warning!"
msgType: "warning" msgType: "warning"
} }
MessageLabel { MessageLabel {
width: parent.width - 2 width: root.width - 2
message: "A critical warning!" message: "A critical warning!"
msgType: "critical" msgType: "critical"
} }
}
} }
//![0] //![0]