Results 1 to 4 of 4

Thread: How can I discriminate different Windows OSs?

  1. #1
    Join Date
    Jun 2008
    Location
    Rome, Italy
    Posts
    95
    Thanks
    19
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default How can I discriminate different Windows OSs?

    Hi to all,
    I need to know which Windows OS version is running but I've found only the Q_WS_WIN macro, could you suggest a better way?
    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How can I discriminate different Windows OSs?

    As far as I know there is no function provided by Qt for that. You have to use the WindowsAPI.

  3. #3
    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: How can I discriminate different Windows OSs?

    Is QSysInfo something that could be used for that?

  4. The following user says thank you to tsp for this useful post:

    cydside (16th February 2010)

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

    Default Re: How can I discriminate different Windows OSs?

    For example if you want to know if the OS is Vista or 7, you can use the following:
    Qt Code:
    1. if (QSysInfo::WindowsVersion >= QSysInfo::WV_6_0) {
    2. // do Vista stuff
    3. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 2
    Last Post: 25th November 2009, 23:44
  2. Deployment Procedure On Windows On Linux and Windows
    By Harshith J.V. in forum Installation and Deployment
    Replies: 4
    Last Post: 9th July 2009, 11:27
  3. Windows focus / Windows Shutdown Problems
    By December in forum Qt Programming
    Replies: 6
    Last Post: 22nd October 2007, 14:10
  4. Replies: 3
    Last Post: 14th April 2007, 12:04
  5. Replies: 10
    Last Post: 25th February 2007, 00:23

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.