Important: Please read the Qt Code of Conduct -

Is there a way to use the pro file to set a qml flag (bool property value) ?

  • I have in the same folder 2 pro files, that way I can build 2 projects with the same code, like a full version versus a free version (with features disabled from the use of the bool flag). It works nice, I just have to load the pro file I want and set the flag to true or false accordingly. I just wonder if I can automize it more and set the flag value from the pro file ?

  • Qt Champions 2017

    Use DEFINES in pro file, use it main.cpp and use setContextProperty to send the value.

  • Thanks, works fine, exactly what I wanted.

Log in to reply