[Qt-interest] void value not ignored as it ought to be

Andrea Franceschini therealmorpheu5 at gmail.com
Thu Mar 26 17:54:05 CET 2009


The same question has been asked in june 2007 and never really
answered, so I'm reiterating it.

I have a class

class Widget : public QObject {
   Q_OBJECT

/* class stuff */
};

and everything goes fine unless I call qobject_cast from a QObject
derived class on a Widget* casting it to with T = PadWidget* which
inherits Widget. Then I get the following build error:

/usr/include/DoodleSDK/includes/Widget.h: In member function ‘void
Doodle::Widget::qt_check_for_QOBJECT_macro(const T&) const [with T =
Doodle::PadWidget]’:
/usr/include/qt4/QtCore/qobject.h:441:   instantiated from ‘T
qobject_cast(QObject*) [with T = Doodle::PadWidget*]’
Tonalizer.cpp:79:   instantiated from here
/usr/include/DoodleSDK/includes/Widget.h:18: error: void value not
ignored as it ought to be

and Widget.h:18 is the Q_OBJECT macro in the Widget class. Does
anybody know something about this issue?

-- 
Andrea




More information about the Qt-interest-old mailing list