Important: Please read the Qt Code of Conduct -

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.qml

    Ask how to define the variable a.


  • Moderators

    You need to either use QML Singleton type, or add the property to rootContext in your engine (in C++).

Log in to reply