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