Hi,
I am writing a diagramming object to use in a graphics scene. It must be capable of emitting some signals, so I derived it from QGraphicsObject.
When I build my program, I get a linker error saying "error: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CmgDiagram::metaObject(void)const " ...". This is typically when moc isn't executed to generate the extra methods for the class. There is no moc_... file in my build output directory either.
This is the definition of my class :
class CmgDiagram : public QGraphicsObject
{
Q_OBJECT
public:
CmgDiagramItem
*getItem
( QString sPath
);
void WriteXML( QXmlStreamWriter *pXML );
private:
CmgDiagramItem *m_pMainItem;
private slots:
void selectionChanged( void );
};
class CmgDiagram : public QGraphicsObject
{
Q_OBJECT
public:
CmgDiagram(QGraphicsScene *pScene, QGraphicsObject * parent = 0);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
CmgDiagramItem *getItem( QString sPath );
void WriteXML( QXmlStreamWriter *pXML );
private:
QGraphicsScene *m_pScene;
CmgDiagramItem *m_pMainItem;
private slots:
void selectionChanged( void );
};
To copy to clipboard, switch view to plain text mode
Why doens't this work ?
MOC runs just fine for another class in the same project that is derived from QGraphicsView.
Best regards,
Marc
Bookmarks