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]
// application.qml
import QtQuick
Column {
Window {
id: root
width: 180
height: 180
padding: 1.5
topPadding: 10.0
bottomPadding: 10.0
spacing: 5
MessageLabel{
width: parent.width - 2
msgType: "debug"
}
MessageLabel {
width: parent.width - 2
message: "This is a warning!"
msgType: "warning"
}
MessageLabel {
width: parent.width - 2
message: "A critical warning!"
msgType: "critical"
visible: true
Column {
anchors.fill: parent
padding: 1.5
topPadding: 10.0
bottomPadding: 10.0
spacing: 5
MessageLabel{
width: root.width - 2
msgType: "debug"
}
MessageLabel {
width: root.width - 2
message: "This is a warning!"
msgType: "warning"
}
MessageLabel {
width: root.width - 2
message: "A critical warning!"
msgType: "critical"
}
}
}
//![0]