-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscene.cpp
More file actions
23 lines (18 loc) · 767 Bytes
/
scene.cpp
File metadata and controls
23 lines (18 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "scene.h"
/*************************************************************************************/
/******************** Scene representing the simulated landscape *********************/
/*************************************************************************************/
/************************************ constuctor *************************************/
scene::scene() : QGraphicsScene()
{
}
void scene::mousePressEvent( QGraphicsSceneMouseEvent* event )
{
// only interested if left mouse button pressed
if ( event->button() != Qt::LeftButton ) return;
// emit informative message
qreal x = event->scenePos().x();
qreal y = event->scenePos().y();
emit message( QString("Clicked at %1,%2").arg(x).arg(y) );
}
#include "scene.moc"