Is there a possibility in Qt5.x (and up) to detect the current Edition of Windows 10 (assuming that the application is running on Windows 10)? Available editions are Home, Pro, Education and Enterprise. I do not like to use Win API functions to detect it. I know about the QSysInfo
class, but it does not offer any functionality to find out the current edition.
Asked
Active
Viewed 667 times
3

Vertexwahn
- 7,709
- 6
- 64
- 90
-
2Qt doesn't care what edition windows is, it cares whether it is windows or something else. The MS APIs are the way to go. – dtech Mar 09 '16 at 22:53
-
1What's the problem at using the native Windows function, once you've figured out you're running under Windows desktop? – peppe Mar 09 '16 at 23:14
-
@peppe that should be done on preprocessor level IMO. Whether the target platform is windows is known at compile time. – dtech Mar 09 '16 at 23:18
-
2"I do not like to use Win API functions..." Well, I've only ever met a single person who did, and he was a little strange. Not liking an API isn't always a reason to avoid it. If you think this is something that QSysInfo should provide you can always open a feature request with Qt. – MrEricSir Mar 09 '16 at 23:29
-
@MrEricSir - that's not true in my experience, most of the people who were forced to use MS APIs from the start and haven't used anything else tend to be overly fond on them :) – dtech Mar 09 '16 at 23:38
-
2@ddriver: that's the point. Add a `#ifdef Q_OS_WIN` and then go for the platform specific bit that QSysInfo just doesn't provide yet. – peppe Mar 10 '16 at 14:15
1 Answers
1
If you looking for Windows 10 detection in general on Qt 5 (not the edition, but the simple fact you're running on Win 8.1 or Win 10), refer to my post here: C++ How to detect Windows 10