The problem is likely that you are including X.h which has
// X.11.h
...
...
#define KeyPress 2
// X.11.h
...
...
#define KeyPress 2
To copy to clipboard, switch view to plain text mode
So the preprocessor is converting this to...
QKeyEvent* kevent = new QKeyEvent(QEvent::2,buffer[0],Qt::NoModifier,buffer,false,1);
To copy to clipboard, switch view to plain text mode
Try adding
#undef KeyPress // safe as long as you are not referencing KeyPress from X.h after this line
#undef KeyPress // safe as long as you are not referencing KeyPress from X.h after this line
QKeyEvent* kevent = new QKeyEvent(QEvent::KeyPress,buffer[0],Qt::NoModifier,buffer,false,1);
To copy to clipboard, switch view to plain text mode
i.e. assuming that further down you won't be referring to KeyPress from X.h
Bookmarks