PDA

View Full Version : How can I discriminate different Windows OSs?



cydside
16th February 2010, 12:48
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!

Lykurg
16th February 2010, 13:52
As far as I know there is no function provided by Qt for that. You have to use the WindowsAPI.

tsp
16th February 2010, 14:41
Is QSysInfo (http://doc.trolltech.com/4.6/qsysinfo.html#WinVersion-enum) something that could be used for that?

toutarrive
17th February 2010, 10:09
For example if you want to know if the OS is Vista or 7, you can use the following:

if (QSysInfo::WindowsVersion >= QSysInfo::WV_6_0) {
// do Vista stuff
}