PDA

View Full Version : Why doesn't this cast?



spraff
18th November 2008, 14:35
Not a Qt-specific question, but here's a funny compiler error:

error: no matching function for call to ‘QCoreApplication::sendEvent(QWidget*, QMouseEvent*&)’
/usr/include/qt4/QtCore/qcoreapplication.h:214: note: candidates are: static bool QCoreApplication::sendEvent(QObject*, QEvent*)

Since QWidget is a QObject and QMouseEvent is a QEvent, why is my compiler (gcc 4.2.4) complaining?

Thanks

pastor
18th November 2008, 15:04
Please show us your code.

Make sure that second value for sendEvent is pointer.

jpn
19th November 2008, 20:28
Probably either one of the classes is forward declared only. Adding suitable include directives should fix the problem.