tags:

views:

68

answers:

2

In Qt docs EnterEditFocus is a event about an editor widget gaining focus for editing but using Qt 4.5.3 the compilation fails with ‘EnterEditFocus’ is not a member of ‘QEvent’. What's wrong?

+1  A: 

You probably forgot to include QEvent.

Most of Qt classes are forward declared, try adding:

#include <QtCore/QEvent>
Idan K
You shouldn't need to specify QtCore, but it certainly won't hurt.
Kaleb Pederson
Thanks for your answer, but didn't work. Changing to QEvent::Enter the compilation is successful even leaving that #include out.
Humberto Pinheiro
+2  A: 

If Idan's suggestion doesn't work, note that QEvent::EnterEditFocus isn't defined unless you built Qt with QT_KEYPAD_NAVIGATION defined. Refer to the following documentation:

http://doc.trolltech.com/4.5/qapplication.html#keypadNavigationEnabled

RA
This is the cause then, thanks for your answer.
Humberto Pinheiro