2017-12-26 22:18:37 +01:00
|
|
|
#ifndef MYGRAPHICSSCENE_H
|
|
|
|
#define MYGRAPHICSSCENE_H
|
|
|
|
|
|
|
|
#include <QGraphicsScene>
|
|
|
|
#include <QGraphicsSceneMouseEvent>
|
2017-12-27 13:08:36 +01:00
|
|
|
#include <QPointF>
|
2017-12-26 22:18:37 +01:00
|
|
|
|
|
|
|
class MyGraphicsScene : public QGraphicsScene
|
|
|
|
{
|
2017-12-27 13:08:36 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
2017-12-26 22:18:37 +01:00
|
|
|
public:
|
2017-12-27 13:08:36 +01:00
|
|
|
explicit MyGraphicsScene();
|
|
|
|
~MyGraphicsScene();
|
|
|
|
|
|
|
|
signals:
|
2018-11-27 00:26:41 +01:00
|
|
|
void positionClicked(QPointF position);
|
2017-12-27 13:08:36 +01:00
|
|
|
void noItemSelected(void);
|
2018-11-27 00:26:41 +01:00
|
|
|
void updateSelectedItem(Qt::MouseButton button);
|
2017-12-26 22:18:37 +01:00
|
|
|
|
|
|
|
private:
|
2018-11-27 00:26:41 +01:00
|
|
|
void mousePressEvent(QGraphicsSceneMouseEvent * const mouseEvent);
|
|
|
|
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * const mouseEvent);
|
2017-12-26 22:18:37 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MYGRAPHICSSCENE_H
|