0

I want to declare a global variable for flag in QML.
Like,

var Flag = true;

I need it so that I can use the Flag at multiple places in QML file.
Is it possible without JavaScript or C++?

If yes, please reply and if not then please help me with coding for a JavaScript or C++ script.

Thank you!

Jino
  • 345
  • 1
  • 2
  • 16
  • 1
    I believe this can solve your problem, [Can we declare global variable in QML file?](http://stackoverflow.com/questions/7515598/can-we-declare-global-variable-in-qml-file?rq=1) – Matthew Jan 28 '14 at 04:53
  • 3
    This should also help, [declare global property in QML for other QML files](http://stackoverflow.com/questions/15257946/declare-global-property-in-qml-for-other-qml-files) – Matthew Jan 28 '14 at 04:57
  • @Matthew Thanks! This is exactly what I was looking for.!! Will try the program now and come back if there's an issue!! – Jino Jan 28 '14 at 08:17

1 Answers1

0

This is how to declare a variable of bool form:

property bool secondaryWindowisActive: false

Here Bool is the type of variable named secondaryWindowisActive and its default value is false .

Jino
  • 345
  • 1
  • 2
  • 16