Answer the question
In order to leave comments, you need to log in
How to connect QGraphicsScene signal and QMainWindow slot?
There is a QMainWindow, on it is a QGraphicsView, which, in turn, is attached to a slightly overridden QGraphicsScene.
Code snippet:
class sectionPlane : public QMainWindow
{
...
public slots:
void draw();
...
};
void sectionPlane::draw()
{
...
}
class GraphicsScene: public QGraphicsScene
{
...
signals:
void move();
...
};
void GraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *me)
{
...
emit move();
}
connect(???, SIGNAL(move()), ???, SLOT(draw()));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question