mirror of https://github.com/qt/qtdoc.git
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:
parent
1f9d0b6267
commit
7630d832ee
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue