How to use variable from one qml to another qml
-
Hello Everyone,
I am new to Qt qml. I am unable to find a way to use a variable from one qml to another qml.
My source qml has a variable like this,
source.qml:
//The flag will be set or reset based on the button events
page {
property int flag: 0onClicked {
//some code here
//setting the flag
flag = 1;
}
}destination.qml
Page {
// some code here
...
stackview.onActivated{
if (flag == 1)
{
//send signal to c++ file
process();
}
}
}Can someone please help me understand how to use the flag in another qml file?
Regards
PK