Discussion Board

Results 1 to 12 of 12

Hybrid View

  1. #1
    Regular Contributor patel_rakesh95's Avatar
    Join Date
    Sep 2010
    Posts
    54
    check Qt Mobility Version number
    Thank's
    Patel Rakesh

  2. #2
    Nokia Developer Champion Nitesh Bhardwaj's Avatar
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777
    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 achipa's Avatar
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327
    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

  4. #4
    Nokia Developer Champion Nitesh Bhardwaj's Avatar
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777
    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

  5. #5
    Registered User laa-laa's Avatar
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    ... and remember that it's a compile-time check, not runtime check.

  6. #6
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Code:
    qDebug() << QTM_VERSION_STR << QT_VERSION_STR;

  7. #7
    Nokia Developer Expert lpotter's Avatar
    Join Date
    Jun 2008
    Location
    Brisbane, Australia
    Posts
    18
    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 danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    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 divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    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 danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    How do you check for that at runtime?

  11. #11
    Nokia Developer Moderator achipa's Avatar
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327
    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 divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved