I made it static because that's the only way it would work with QAbstractEventDispatcher(). I was experiencing some difficulties with setting QAbstractEventDispatcher() filter and a thread here in QtCentre Forum said that I should make eventFilter() static, I did and it worked. Only for that reason. But if there is a better way I would really like to know.
EDIT:
if I remove "static" from eventFilter I get this error message:
qapp.cpp: In constructor 'QApp::QApp(int&, char**)':
qapp.cpp:14: error: no matching function for call to 'QAbstractEventDispatcher::setEventFilter(<unresolved overloaded function type>)'
c
:\Qt\
2010.05\qt\include\QtCore
/..
/..
/src
/corelib
/kernel
/qabstracteventdispatcher.
h:91: note
: candidates are
: bool (* QAbstractEventDispatcher::setEventFilter(bool (*)(void*)))(void*)
qapp.cpp: In constructor 'QApp::QApp(int&, char**)':
qapp.cpp:14: error: no matching function for call to 'QAbstractEventDispatcher::setEventFilter(<unresolved overloaded function type>)'
c:\Qt\2010.05\qt\include\QtCore/../../src/corelib/kernel/qabstracteventdispatcher.h:91: note: candidates are: bool (* QAbstractEventDispatcher::setEventFilter(bool (*)(void*)))(void*)
To copy to clipboard, switch view to plain text mode
Bookmarks