Results 1 to 8 of 8

Thread: version number setting

  1. #1
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default version number setting

    hi, im using QT4.5 in debian
    i want to know , how to set version number for qt applications ?

    Thnks
    Bala

  2. #2
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: version number setting

    QCoreApplication class contains methods setApplicationName and setApplicationVersion but I think it is up to you to decide how to use those. I have used them every now and then for example to set dialog title to same as the application name and for that I have used applicationName-method.

  3. #3
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Thanks
    2
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: version number setting

    Maybe you could choose from one of the following:

    Define the version information within the application source code (string constant or preprocessor macro).
    Use QCoreApplication : applicationVersion() and setApplicationVersion(const QString&version).
    Define the version information in the .pro file using qmake macro VERSION.
    Last edited by toutarrive; 12th March 2010 at 10:02.

  4. #4
    Join Date
    Jan 2006
    Posts
    18
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: version number setting

    Define the version information in the .pro file using qmake macro VERSION.
    If one uses the above method is there anyway of passing this to the application code at compilation stage? So for instance it is compiled as a variable into the code and can be used to display to the user the version number of the program.

    Thanks,
    Royce

  5. #5
    Join Date
    Jul 2008
    Location
    Norway
    Posts
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: version number setting

    Check out this link on the subject http://www.openguru.com/2009/11/qt-b...n-version.html
    !sirius

  6. The following user says thank you to sirius for this useful post:

    Royceybaby (9th June 2010)

  7. #6
    Join Date
    Jan 2006
    Posts
    18
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: version number setting

    Brilliant link.

    Thanks,
    Royce

  8. #7
    Join Date
    Mar 2010
    Location
    The Netherlands
    Posts
    7
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: version number setting

    Indeed a briliant link. But I want to read the version number from a non-running executable on Linux.
    Any ideas on how to fix this?
    I'm a complete linux noob, so there might be something very simple I'm missing here.
    0x2B || !0x2B // Hamlet

  9. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: version number setting

    One way to do that would be to use a string that can be searched for in the executable. For example "$VERSION_TAG$1.04$". So then you can just open the executable file as binary data, search for the tag and read the text afterwards.

Similar Threads

  1. Creating an evaluation version or trial version
    By munna in forum General Discussion
    Replies: 9
    Last Post: 20th June 2015, 02:50
  2. Replies: 0
    Last Post: 11th August 2009, 10:38
  3. Replies: 5
    Last Post: 5th October 2008, 06:12
  4. qmake + Incremented Builder Version Number
    By NoRulez in forum Qt Programming
    Replies: 1
    Last Post: 9th May 2008, 16:15
  5. Version setting in QT Program
    By sabeesh in forum Qt Programming
    Replies: 4
    Last Post: 24th October 2007, 13:07

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.