Figure out how to pass in properties.

This commit is contained in:
Dorian 2018-02-13 15:18:59 -05:00
parent 7b36312ed3
commit 329152860d
2 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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 {