[Interest] Unable to call QKeyEvent::key()

Samuel Gaist samuel.gaist at edeltech.ch
Tue Jan 29 09:56:05 CET 2013


Hi,

did you #include <QKeyEvent> in your cpp file ?

Hope it helps
Samuel

On 29 janv. 2013, at 09:22, <bb6xt at yahoo.com> <bb6xt at 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 at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list