Q_WS_X11 will be defined for Meego, Raspberry Pi, Pandora, ... as well.
I usually use #if defined(Q_WS_X11) && !defined(USING_GLES2)