In my QT application, I want to move all of my UI strings to a central file, such as below:
SharedStrings.qml:
import QtQuick 2.0
pragma Singleton
QtObject {
readonly property string buttonOKString: "OK"
readonly property string buttonCancelString: "CANCEL"
}
Example.qml:
text: SharedStrings.buttonOKString
The only issue is that, as I understand it, this creates a property binding, which allow Example.qml's text to update whenever the value in SharedStrings.qml changes. However, this is unneeded since these values will not change. This is an embedded app so any memory/processing I can save is beneficial.
Is there a way I can define strings in a single file and used in other qml files, without using property binding?