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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -