Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    How to get the VERSION from QML?

    Mobile and Embedded
    4
    5
    7119
    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.
    • G
      GentooXativa last edited by

      Im using the VERSION macro at .pro file. Exists any way to get it from QML or C++?

      @VERSION = 1.0.0@

      Jose Vicente Giner Sanchez - Senior Mobile Developer

      www.gigigo.com

      C/ Dr. Zamenhof 36bis, 1ºA 28027 Madrid
      T: +34 917431436

      1 Reply Last reply Reply Quote 0
      • A
        akrynski last edited by

        Tried to use QApplication.applicationVersion()?

        --
        Pozdrawiam i do następnego...
        Greetings and till next...

        1 Reply Last reply Reply Quote 0
        • M
          maxvanceffer last edited by

          But if i am using it in shared library ?

          QString(VERSION) undefined VERSION

          1 Reply Last reply Reply Quote 0
          • L
            lgeyer last edited by

            See "this":http://qt-project.org/forums/viewthread/11840 thread.

            If you want to pass the VERSION information from the .pro file to C++ you may use the preprocessor.
            @
            // .pro
            DEFINES += APPLICATION_VERSION="\"$$VERSION\""

            // .cpp
            QString applicationVersion(APPLICATION_VERSION);
            @
            If you want to pass this version information to QML use a context property.

            1 Reply Last reply Reply Quote 0
            • M
              maxvanceffer last edited by

              Thx, ))) worked

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