linker-error bei Aufruf von custom Signal in mousePressEvent
Verfasst: 27. Mai 2010 18:52
EDIT: tut mir leid, hab wollte eigentlich ins Forum QT Programmierung posten..
ich will von meiner QGraphicsScene Infos (zb Mausposition) an mein mainwindow weitersenden und hab dafür in meiner QGraphicsScene ein custom Signal implementiert, das von mousePressEvent() emittiert wird.
beim Kompilieren bekomm ich aber dann einen linker-error, an dem ich jetzt schon eine Zeit lang tüftle...
ich sitz da irgendwie grad auf der Leitung...
ich will von meiner QGraphicsScene Infos (zb Mausposition) an mein mainwindow weitersenden und hab dafür in meiner QGraphicsScene ein custom Signal implementiert, das von mousePressEvent() emittiert wird.
beim Kompilieren bekomm ich aber dann einen linker-error, an dem ich jetzt schon eine Zeit lang tüftle...
Code: Alles auswählen
Error 1 error LNK2019: unresolved external symbol "protected: void __thiscall GraphicsScene::mousePos(class QPointF const &)" (?mousePos@GraphicsScene@@IAEXABVQPointF@@@Z) referenced in function "protected: virtual void __thiscall GraphicsScene::mousePressEvent(class QGraphicsSceneMouseEvent *)" (?mousePressEvent@GraphicsScene@@MAEXPAVQGraphicsSceneMouseEvent@@@Z) GraphicsScene.objCode: Alles auswählen
#ifndef GRAPHICSSCENE_H
#define GRAPHICSSCENE_H
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
using namespace std;
class GraphicsScene : public QGraphicsScene
{
public:
GraphicsScene( QObject *parent = 0);
protected:
void mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent );
signals:
void mousePos( const QPointF& );
};
#endif // GRAPHICSSCENE_HCode: Alles auswählen
#include "GraphicsScene.h"
GraphicsScene::GraphicsScene( QObject *parent ) : QGraphicsScene( parent )
{
}
void GraphicsScene::mousePressEvent( QGraphicsSceneMouseEvent * mouseEvent )
{
emit mousePos(mouseEvent->scenePos());
}