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.

    --------------------------------------------------------------------------------------------------------qt中国群218967017


  • Moderators

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.