How to define a global variable.
-
How to define a global variable, that references the variable values at different QML file. For example, 1.qml is defined in a a=1 variable, and then determine the value of the variable a is equal to 1.
in 2.qmlAsk how to define the variable a.
--------------------------------------------------------------------------------------------------------qt中国群218967017
-
You need to either use QML Singleton type, or add the property to rootContext in your engine (in C++).