Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to get the VERSION from QML?
Forum Updated to NodeBB v4.3 + New Features

How to get the VERSION from QML?

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 4 Posters 7.9k Views 1 Watching
  • 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 Offline
    G Offline
    GentooXativa
    wrote on last edited by
    #1

    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
    0
    • A Offline
      A Offline
      akrynski
      wrote on last edited by
      #2

      Tried to use QApplication.applicationVersion()?

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

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxvanceffer
        wrote on last edited by
        #3

        But if i am using it in shared library ?

        QString(VERSION) undefined VERSION

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          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
          0
          • M Offline
            M Offline
            maxvanceffer
            wrote on last edited by
            #5

            Thx, ))) worked

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved