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

Thiago Macieira thiago.macieira at trolltech.com
Thu Mar 26 20:05:37 CET 2009


Em Quinta-feira 26 Março 2009, às 17:54:05, Andrea Franceschini escreveu:
> 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?

Does the Doodle::PadWidget class have a Q_OBJECT macro?

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
     Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090326/61777628/attachment.bin 


More information about the Qt-interest-old mailing list