What is the difference between Q_WS_* and Q_OS_* in Qt and when would you use one over the other? I understand that OS is defined on an operating system, and WS is defined for a window system, but I can’t see when you’d use one over the other. Wouldn’t Q_WS_MAC and Q_OS_MAC be the same, for example? What’s the general rule and could I have some example use cases for each?
Share
Simple. You use
Q_OSflagging when you need operating system specific code andQ_WSwhen you need window system specific code.As an example, UI for Maemo devices (
Q_WS_MAEMO_5) often needs to be different from Linux desktop but both are stillQ_OS_LINUX.