Figure out how to pass in properties.
This commit is contained in:
parent
7b36312ed3
commit
329152860d
4
Menu.qml
4
Menu.qml
|
@ -29,7 +29,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: version
|
id: versionLabel
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
@ -41,7 +41,7 @@ Rectangle {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
// TODO: Add in a way to dynamically get the version of the app.
|
// TODO: Add in a way to dynamically get the version of the app.
|
||||||
text: "Version 0.4.0"
|
text: "v" + appVersion
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 20
|
anchors.rightMargin: 20
|
||||||
|
|
8
main.qml
8
main.qml
|
@ -2,15 +2,21 @@ import QtQuick 2.9
|
||||||
import QtQuick.Window 2.2
|
import QtQuick.Window 2.2
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
|
|
||||||
|
id: mainWindow
|
||||||
|
property var appVersion: "0.4.0"
|
||||||
|
|
||||||
visible: true
|
visible: true
|
||||||
width: 800
|
width: 800
|
||||||
height: 600
|
height: 600
|
||||||
title: qsTr("justCheckers")
|
title: qsTr("justCheckers v" + appVersion)
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: appPage
|
id: appPage
|
||||||
source: "Menu.qml"
|
source: "Menu.qml"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
property var version: appVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
Loading…
Reference in New Issue