PDA

View Full Version : using win or linux?



mattia
19th March 2008, 07:06
Hi,
what should i do to know which OS my application is running on?
I have to check if it's running on Windows or Linux machine, is there anything better then enum QSysInfo::WinVersion?
thx

ChristianEhrlicher
19th March 2008, 07:48
you can also use those preprocessor defines:

http://doc.trolltech.com/4.3/qtglobal.html#Q_WS_X11

THRESHE
19th March 2008, 11:51
Use QSysInfo class

Sorry didn't read post to the end :o

fullmetalcoder
19th March 2008, 21:46
Hi,
what should i do to know which OS my application is running on?
I have to check if it's running on Windows or Linux machine, is there anything better then enum QSysInfo::WinVersion?
thx
Basically, your application should always be running on the OS on which it has been compiled (except for versions of course) so preprocessors should do here. Alternatively, if you don't want to mess with preprocessors everywhere just define a global method returning an enum (e.g {Linux, Mac, Windows, ...}) whose return value would be set through preprocessors. And finally, I doubt there is a clean method to determine whether the app might be running on an emulator (eg Wine...)