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 retrieve program name & version
Forum Updated to NodeBB v4.3 + New Features

How to retrieve program name & version

Scheduled Pinned Locked Moved Mobile and Embedded
10 Posts 4 Posters 4.8k 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.
  • K Offline
    K Offline
    kimf
    wrote on last edited by
    #1

    Hi

    How do I retrieve program name and version of my application ?

    I have tried using QCoreApplication.appVersion & QCoreApplication.appName, but they are always empty !

    I have set Version = 1.5.0 in the .pro file, to no avail.

    I using the latest Nokia SDK and developing for maemo.

    Any ideas ?

    Kim

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

      applicationName and applicationVersion aren't automatically set, they have to be set by you.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kimf
        wrote on last edited by
        #3

        OK, well that explains why they always are empty.

        But then, how do I retrieve the program version number ?

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

          As far as I know the VERSION variable is used for generating appropriate filenames only. There is no automatic propagation to the applicationVersion property.

          If you want to access variables set in your project file you will have to create preprocessor defines out of it.
          @
          // .pro
          DEFINES += APP_NAME=\"$$TARGET\"
          DEFINES += APP_VERSION=\"$$VERSION\"

          // .cpp
          application.setApplicationName(APP_NAME);
          application.setApplicationVersion(APP_VERSION);
          @

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kimf
            wrote on last edited by
            #5

            I'll try that.

            Thanks

            1 Reply Last reply
            0
            • AlicemirrorA Offline
              AlicemirrorA Offline
              Alicemirror
              wrote on last edited by
              #6

              @Lukas, I have a similar problem at project level.

              In Qt Creator withing projects for Harmattan Meego 1.2 the project release, version and subversion can be set in the project tab and are coherent with the package creation. Is there a similar way with project for Symbian and/or desktop devices?

              Thanks you

              Enrico Miglino (aka Alicemirror)
              Balearic Dynamics
              Islas Baleares, Ibiza (Spain)
              www.balearicdynamics.com

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

                Not that I know of.

                But the version information used in Harmattan projects is used for deployment only, and not automatically propagated to applicationVersion as well, is it?

                1 Reply Last reply
                0
                • AlicemirrorA Offline
                  AlicemirrorA Offline
                  Alicemirror
                  wrote on last edited by
                  #8

                  Lukas,

                  to be honest I think yes.
                  As what I have understood. It is very useful your note about symbian because I was just asking to myself how it was possible to have the same information for symbian applications. Now I am working on a Meego development so I will check in next hours if the application version really propagate to the in-program information.

                  The fact is that in Harmattan (that is a linux os) you are obliged to set the versioning in a correct way, not only. As I have experienced publishing with Ovi Store my Harmattan Application, the version number can only grow and never change with numbers less than the last you have created. Ovi store take this information from the application and the installer too: in the application info when it is installed on the device one of the information you see is just the release.version.subversion numbers.

                  Instead for symbian devices Ovi does not mention this aspect regarding the publishing of the applications. I was confused about the symbian case so now I check Harmattan and tell you asap. For symbian, I keep correct what you tell but I should read again the publishing specifications of Ovi Store. It is possible that before publishing Ovi requires a valid versioning system - with the method that you have mentioned - also for the symbian applications.
                  Without any settings, the symbian installed applications reports always the version 1.0.0

                  Enrico Miglino (aka Alicemirror)
                  Balearic Dynamics
                  Islas Baleares, Ibiza (Spain)
                  www.balearicdynamics.com

                  1 Reply Last reply
                  0
                  • AlicemirrorA Offline
                    AlicemirrorA Offline
                    Alicemirror
                    wrote on last edited by
                    #9

                    Hi,

                    I have checked now and confirm. The application informations seems to be propagated to the application. I suppose that it's where the N950 installer manager read to give the information about the package, version etc.

                    Enrico Miglino (aka Alicemirror)
                    Balearic Dynamics
                    Islas Baleares, Ibiza (Spain)
                    www.balearicdynamics.com

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      tobias.hunger
                      wrote on last edited by
                      #10

                      IIRC we use the version information for the packages only. They are put into the package's meta-information, and not set on the QCoreApplication.

                      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