Created
December 19, 2015 14:13
-
-
Save kimmoli/edf1feaba57497aa0fa6 to your computer and use it in GitHub Desktop.
noarch version from spec to QML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
system(echo "\\\{\\\"version\\\":\\\"$${SPECVERSION}\\\"\\\}" > qml/version.json) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ApplicationWindow | |
{ | |
..blaa.. | |
property var application | |
Component.onCompleted: | |
{ | |
var xhr = new XMLHttpRequest | |
xhr.onreadystatechange = (function(myxhr) | |
{ | |
return function() | |
{ | |
if (myxhr.readyState === 4) | |
{ | |
application = JSON.parse(myxhr.responseText) | |
} | |
} | |
})(xhr); | |
xhr.open("GET", Qt.resolvedUrl("version.json"), true) | |
xhr.send(); | |
} | |
...blaa... | |
} | |
use e.g. | |
text: "version: " + application.version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
%qtc_qmake5 SPECVERSION=%{version} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment