Humberto Pinheiro
Humberto Pinheiro

Reputation: 1174

Qt 4.5.3 QEvent::EnterEditFocus

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?

Upvotes: 1

Views: 1203

Answers (3)

RA.
RA.

Reputation: 7777

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.qt.io/archives/4.6/qapplication.html#keypadNavigationEnabled

Upvotes: 3

yan bellavance
yan bellavance

Reputation: 4830

Look at the following quote from qt documentation on keypad navigation. It sounds like this feature is deprecated or preferably used on embedded platforms:

bool QApplication::keypadNavigationEnabled () [static]
This function is deprecated. Returns true if Qt is set to use keypad navigation; otherwise returns false. The default value is true on Symbian, but false on other platforms. This feature is available in Qt for Embedded Linux, Symbian and Windows CE only. Note: On Windows CE this feature is disabled by default for touch device mkspecs. To enable keypad navigation, build Qt with QT_KEYPAD_NAVIGATION defined. See also navigationMode().

this might make more sense if you are aware that in the source code for the QEvent::Type there is the following:


#ifdef QT_KEYPAD_NAVIGATION
EnterEditFocus = 150, // enter edit mode in keypad navigation
LeaveEditFocus = 151, // enter edit mode in keypad navigation
#endif

Upvotes: 0

Idan K
Idan K

Reputation: 20881

You probably forgot to include QEvent.

Most of Qt classes are forward declared, try adding:

#include <QtCore/QEvent>

Upvotes: 0

Related Questions