With the following includes:
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
I needed to undef a few definitions:
#undef Bool
#undef CursorShape
#undef Expose
#undef KeyPress
#undef KeyRelease
#undef FocusIn
#undef FocusOut
#undef FontChange
#undef None
#undef Status
#undef Unsorted
Of course add LIBS += -lX11
in your .pro file, and you are good to go!