qml-old/examples/helloworld.qml

50 lines
1.0 KiB
QML
Raw Normal View History

2021-04-10 09:43:03 +00:00
import QtQuick 2.5
import QtQuick.Window 2.2
2022-02-04 17:47:36 +00:00
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
2021-04-10 09:43:03 +00:00
Window {
2022-02-04 17:47:36 +00:00
id: window
2022-02-05 12:38:15 +00:00
objectName: "window"
2021-04-10 09:43:03 +00:00
visible: true
2022-02-04 17:47:36 +00:00
width: 800
height: 600
2022-02-05 12:38:15 +00:00
signal close
onVisibilityChanged: {
if(visibility == Window.Hidden)
close()
}
ColumnLayout {
2022-02-04 17:47:36 +00:00
id: rowlayout
anchors.fill: parent
spacing: 30
Rectangle {
id: toprectangle
Layout.fillWidth: true
Layout.preferredHeight: 240
color: "lightgray"
Text {
id: helloText
2022-02-05 12:38:15 +00:00
objectName: "helloText"
2022-02-04 17:47:36 +00:00
text: "Hello World!"
y: 30
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: 24; font.bold: true
}
}
2022-02-05 12:38:15 +00:00
RowLayout {
2022-02-04 17:47:36 +00:00
spacing: 15
Layout.fillWidth: true
Layout.fillHeight: true
2022-02-05 12:38:15 +00:00
Text {
text: qsTr("Change the text above:")
}
2022-02-04 17:47:36 +00:00
TextField {
id: nameInputField
objectName: "nameInputField"
placeholderText: qsTr("Enter your name")
}
}
2021-04-10 09:43:03 +00:00
}
}