From 329152860dfb7208032979853f7412818cf01e84 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Tue, 13 Feb 2018 15:18:59 -0500 Subject: [PATCH] Figure out how to pass in properties. --- Menu.qml | 4 ++-- main.qml | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Menu.qml b/Menu.qml index f69821f..f6d3db3 100644 --- a/Menu.qml +++ b/Menu.qml @@ -29,7 +29,7 @@ Rectangle { } Rectangle { - id: version + id: versionLabel anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom @@ -41,7 +41,7 @@ Rectangle { Text { // 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.right: parent.right anchors.rightMargin: 20 diff --git a/main.qml b/main.qml index 41352d1..2f994d4 100644 --- a/main.qml +++ b/main.qml @@ -2,15 +2,21 @@ import QtQuick 2.9 import QtQuick.Window 2.2 Window { + + id: mainWindow + property var appVersion: "0.4.0" + visible: true width: 800 height: 600 - title: qsTr("justCheckers") + title: qsTr("justCheckers v" + appVersion) Loader { id: appPage source: "Menu.qml" anchors.fill: parent + + property var version: appVersion } MouseArea {