blob: dcc7d1cf5f250df67a5d41606b12c9183306d7b2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include "mygraphicsscene.h"
#include <QDebug>
MyGraphicsScene::MyGraphicsScene()
{
}
MyGraphicsScene::~MyGraphicsScene()
{
}
void MyGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent* const mouseEvent)
{
const QGraphicsItem* const it = itemAt(mouseEvent->scenePos(), QTransform());
if (it != nullptr)
{
emit positionClicked(mouseEvent->scenePos());
}
else
{
// No items selected
emit noItemSelected();
}
}
void MyGraphicsScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* const mouseEvent)
{
emit updateSelectedItem(mouseEvent->button());
}
|