Solved Convert text to uppercase
-
Hi
I have a qml item defined asimport QtQuick 2.0 import QtQuick.Controls 2.3 import "../../Customisation" Item { id: systemControlApp Label { id: label x: 241 y: 168 width: 320 height: 110 text: Qt.binding(function() { return Style.systemControl.appLabel }) font.pointSize: 25 } }
The Style.qml
QtObject { property QtObject systemControl: QtObject { property string appLabel: "System Control" property color color: "#B7B865" property string imagePath: "/images/Section_SystemControl.svg" } }
What I was hoping to achieve was to set the text in the item to value of the appLabel in Style BUT in Uppercase.
As it stands I get this error
Unable to assign a function to a property of any type other than var.
Any ideas on how to implement this?
Thanks
-
You could do:
text: Style.systemControl.appLabel.toUpperCase() // (Qt.binding is not need for declarative assignment)
or even:
text: Style.systemControl.appLabel font.capitalization: Font.AllUppercase
-
Hi Thanks
I did try these without success - but it seems that it was not working for a seemingly unrelated error.Thanks for your help