Results 1 to 11 of 11

Thread: How can I know the version of my application? [Qt3]

  1. #1
    Join Date
    Jan 2006
    Location
    Moscow, Russia
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How can I know the version of my application? [Qt3]

    Hello!

    My pro-file consist a string:
    VERSION=1.0

    How can I get the version, wich I wrote in pro-file?

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: How can I know the version of my application? [Qt3]

    maiby QSettings can help you, but i'm not sure
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Jan 2006
    Location
    Moscow, Russia
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I know the version of my application? [Qt3]

    QSettings does not consist information about version

  4. #4
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: How can I know the version of my application? [Qt3]

    so use QFile and take it manually
    a life without programming is like an empty bottle

  5. #5
    Join Date
    Jan 2006
    Location
    Moscow, Russia
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I know the version of my application? [Qt3]

    This method is not correct. Is there any functions to get the version number?

  6. #6
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I know the version of my application? [Qt3]

    Quote Originally Posted by Opilki_Inside
    Hello!

    My pro-file consist a string:
    VERSION=1.0

    How can I get the version, wich I wrote in pro-file?
    It is from qmake manual:

    VERSION - The version number of the target library, for example, 2.3.1.

  7. #7
    Join Date
    Jan 2006
    Location
    Moscow, Russia
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I know the version of my application? [Qt3]

    Quote Originally Posted by Mad Max
    It is from qmake manual:

    VERSION - The version number of the target library, for example, 2.3.1.
    So what? I need to get this VERSION from source code of my application...

  8. #8
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I know the version of my application? [Qt3]

    Quote Originally Posted by Opilki_Inside
    So what? I need to get this VERSION from source code of my application...
    This template exist for UNIX libraries only (for formation of a name of the library file, such as libmy.so.1.1.0 ). If you wish to have the version of your app then keep it in a code as a constant.

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can I know the version of my application? [Qt3]

    Quote Originally Posted by Opilki_Inside
    So what? I need to get this VERSION from source code of my application...
    So provide some method to get it For example look for 'static const char *version="1.0";' in your code. Use grep or whatever tool you like.

  10. #10
    Join Date
    Jan 2006
    Location
    Wells, Somerset, UK
    Posts
    4
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I know the version of my application? [Qt3]

    Quote Originally Posted by Opilki_Inside
    My pro-file consist a string:
    VERSION=1.0

    How can I get the version, wich I wrote in pro-file?
    If this is using windows, then qmake/make creates standard windows VS_VERSION_INFO resource information for your application. This can be accessed via the win32 function GetFileVersionInfo().

    Obviously this is not platform independant. Unfortunately i don't know how this is handled on other platforms.

    Smudge.

  11. #11
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How can I know the version of my application? [Qt3]

    I somehow accidentally came across to a solution like this:
    DEFINES += MYAPP_VERSION=0x000501"
    Qt Code:
    1. QString version("%1.%2.%3").
    2. .arg(MYAPP_VERSION & 0xFF0000)
    3. .arg(MYAPP_VERSION & 0x00FF00)
    4. .arg(MYAPP_VERSION & 0x0000FF); // "0.5.1"
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. Deploy Qt application on Mac OS X
    By giandrea77 in forum Installation and Deployment
    Replies: 3
    Last Post: 11th February 2009, 09:34
  2. Designer doesn't load wwWidgets plugin
    By reimer in forum Installation and Deployment
    Replies: 21
    Last Post: 7th February 2009, 03:23
  3. Problem with application version and icon
    By cutie.monkey in forum Qt Programming
    Replies: 3
    Last Post: 18th December 2008, 01:22
  4. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  5. Replies: 15
    Last Post: 21st April 2007, 17:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.