[Qt-interest] Error in class inheriting QGraphicsItem, QObject
Thiago Macieira
thiago.macieira at trolltech.com
Fri Aug 21 08:49:56 CEST 2009
varun singh wrote:
>hi,
>
>I want to achieve custom signals and slots funcionality with
> QGraphicsItem in my class. But doing so is giving some errors. The code
> is:
>***************************************
>#include <QApplication>
>#include <QtGui>
>
>class t : public QGraphicsItem, public QObject
[snip]
>The thing works fine if I comment Q_OBJECT macro definition and signals
> part.
>
>Am I missing something or am I trying it in the wrong way?
Hi Varun
Three suggestions for you, in increasing order of recommendation.
Suggestion 1:
class t: public QObject, public QGraphicsItem
Suggestion 2:
class t: public QGraphicsObject
Suggestion 3:
class t: public QGraphicsWidget
--
Thiago Macieira - thiago.macieira (AT) nokia.com
Senior Product Manager - Nokia, Qt Development Frameworks
Sandakerveien 116, NO-0402 Oslo, Norway
Qt Developer Days 2009 | Registration Now Open!
Munich, Germany: Oct 12 - 14 San Francisco, California: Nov 2 - 4
http://qt.nokia.com/qtdevdays2009
-------------- 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/20090821/fb554375/attachment.bin
More information about the Qt-interest-old
mailing list