×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    Sep 2010
    Posts
    54

    Post how to check Qt Mobility version?

    check Qt Mobility Version number
    Thank's
    Patel Rakesh

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: how to check Qt Mobility version?

    Quote Originally Posted by patel_rakesh95 View Post
    check Qt Mobility Version number
    what do you mean by check version number? do you want to check programmatically?
    if it is so, AFAIK, there is no way.

  3. #3
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to check Qt Mobility version?

    Code:
    qDebug() << QTM_VERSION_STR << QT_VERSION_STR;

  4. #4
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327

    Re: how to check Qt Mobility version?

    Quote Originally Posted by Nitesh Bhardwaj View Post
    what do you mean by check version number? do you want to check programmatically?
    if it is so, AFAIK, there is no way.
    You can actually do that just in the same way you would with goold old qt

    Code:
     #if QTM_VERSION >= 0x010100
    // ... QtMobility 1.1 code
    #else
    // ... QtMobility 1.0.x code
    #endif

  5. #5
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: how to check Qt Mobility version?

    Quote Originally Posted by achipa View Post
    You can actually do that just in the same way you would with goold old qt
    yes, i was thinking wrong

  6. #6
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

    Re: how to check Qt Mobility version?

    ... and remember that it's a compile-time check, not runtime check.

  7. #7
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Brisbane, Australia
    Posts
    18

    Re: how to check Qt Mobility version?

    There is a runtime check in QSystemInfo for version later than 1.1

    QSystemInfo::version(QSystemInfo::QtMobility); will return a string.
    Code Monkey, QtMobility, Nokia

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to check Qt Mobility version?

    Quote Originally Posted by lpotter View Post
    There is a runtime check in QSystemInfo for version later than 1.1

    QSystemInfo::version(QSystemInfo::QtMobility); will return a string.
    And, of course, it will fail to compile on older versions.

  9. #9
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to check Qt Mobility version?

    Quote Originally Posted by danhicksbyron View Post
    And, of course, it will fail to compile on older versions.
    This is a check implemented trough a compilation fail.

  10. #10
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to check Qt Mobility version?

    How do you check for that at runtime?

  11. #11
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327

    Re: how to check Qt Mobility version?

    Just out of curiosity, what is the use case for that (apart from informative/support purposes) ? You're not using a dynamic programming language, so even though you have things like the meta-object thing and introspection, the gains are very limited and offset by a lot of code complexity...

  12. #12
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to check Qt Mobility version?

    Quote Originally Posted by danhicksbyron View Post
    How do you check for that at runtime?
    The problem with runtime is that ld will abort() you application as fast as it will be able to find out that your application is using Qt Mobility 1.1 symbols on system with Qt Mobilty 1.0.2. The only way to avoid such unfortunate situation is to use Qt Mobility trough QLibrary.

Similar Threads

  1. Qt Creator code completion not working with Qt Mobility for Symbian
    By ceefour in forum [Archived] Qt Mobility Project
    Replies: 4
    Last Post: 2011-09-10, 05:02
  2. Replies: 35
    Last Post: 2010-09-13, 12:05
  3. Replies: 3
    Last Post: 2010-06-30, 01:17
  4. QT Mobility Production Version
    By marktorrens in forum [Archived] Qt Mobility Project
    Replies: 2
    Last Post: 2010-04-21, 17:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •