Hi, did you #include <QKeyEvent> in your cpp file ?
Hope it helps Samuel On 29 janv. 2013, at 09:22, <bb...@yahoo.com> <bb...@yahoo.com> wrote: > Hi, > Much as it gets boring seeing posts which start with *noob alert* warnings I > am kind of in the same position right now. However, I have used Qt > extensively via PySide though am just starting off with c++/Qt. > I am trying to reimplement the keyPressEvent on a class which inherits > QMainWindow but if I call event->key() it throws an error saying "invalid use > of incomplete type 'class QKeyEvent' from > /opt/lib/Qt5.0.0/5.0.0/gcc/include/QtWidgets/qmainwindow.h:45:0". > The constructor is: > void Window::keyPressEvent(QKeyEvent *event). I installed Qt using the latest > Qt5 installer on Ubuntu 12.10. > Thanks in advance. > - Ab. > > -------------------------- > Sent from my mobile device > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest