Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    QML and Qt Quick
    2
    3
    137
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • johngod
      johngod last edited by

      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 ?

      1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

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

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply Reply Quote 6
        • johngod
          johngod last edited by

          Thanks, works fine, exactly what I wanted.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post