die frage ist, warum ich vordeklarieren muss? Warum ist in der Def keine ‘GraphicsSceneMouseEvent’ drinne?
Code: Alles auswählen
class GraphicsScene : public QGraphicsScene
{
private:
...
public:
GraphicsScene(QObject *parent = 0) : QGraphicsScene(parent)
{}
GraphicsScene ( const QRectF & sceneRect, QObject * parent = 0 ) : QGraphicsScene(parent) {
this->setSceneRect(sceneRect);
}
GraphicsScene ( qreal x, qreal y, qreal width, qreal height, QObject * parent = 0 ) : QGraphicsScene(parent) {
this->setSceneRect(x, y, width, height);
}
~GraphicsScene() {
...
}
...
protected:
...
//Maus
void mouseMoveEvent(GraphicsSceneMouseEvent *event);
void mousePressEvent(GraphicsSceneMouseEvent *event);
void mouseReleaseEvent(GraphicsSceneMouseEvent *event);
void mouseDoubleClickEvent(GraphicsSceneMouseEvent *event);
...
};Code: Alles auswählen
./battlefield/scene.h:45: error: ‘GraphicsSceneMouseEvent’ has not been declared
./battlefield/scene.h:47: error: ‘GraphicsSceneMouseEvent’ has not been declared
./battlefield/scene.h:48: error: ‘GraphicsSceneMouseEvent’ has not been declared
./battlefield/scene.h:49: error: ‘GraphicsSceneMouseEvent’ has not been declared