c++ - Add conditional macro depending on Qt version -


one can compile different code depending on current qt version:

#if qt_version < 0x050000 ..... #else ..... #endif 

however, qt4 , qt5 have different macros checking operating system: q_ws_win -> q_os_win , q_ws_x11 -> q_os_linux, respectively. how add #ifdef macro operating system?

you not need use qt_version, can check both versions this:

#if defined(q_ws_win) || defined(q_os_win) // windows... #elif defined(q_ws_x11) || defined(q_os_linux) // linux... #endif 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -