Initial commit of the Draw Map Scene
authorunc0rr
Sat, 27 Nov 2010 22:40:29 +0300
changeset 4423 4391526e436e
parent 4422 5e8cfef25ccb
child 4424 3225ea34e415
Initial commit of the Draw Map Scene
tools/drawMapTest/drawmapscene.cpp
tools/drawMapTest/drawmapscene.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/drawMapTest/drawmapscene.cpp	Sat Nov 27 22:40:29 2010 +0300
@@ -0,0 +1,26 @@
+#include <QDebug>
+#include <QGraphicsSceneMouseEvent>
+
+#include "drawmapscene.h"
+
+DrawMapScene::DrawMapScene(QObject *parent) :
+    QGraphicsScene(parent)
+{
+    setSceneRect(0, 0, 4096, 2048);
+}
+
+void DrawMapScene::mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent)
+{
+
+    qDebug() << "move" << mouseEvent->scenePos();
+}
+
+void DrawMapScene::mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent)
+{
+    qDebug() << "press" << mouseEvent->scenePos();
+}
+
+void DrawMapScene::mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent)
+{
+    qDebug() << "release" << mouseEvent->scenePos();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/drawMapTest/drawmapscene.h	Sat Nov 27 22:40:29 2010 +0300
@@ -0,0 +1,22 @@
+#ifndef DRAWMAPSCENE_H
+#define DRAWMAPSCENE_H
+
+#include <QGraphicsScene>
+
+class DrawMapScene : public QGraphicsScene
+{
+Q_OBJECT
+public:
+    explicit DrawMapScene(QObject *parent = 0);
+
+signals:
+
+public slots:
+
+private:
+    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent);
+    virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent);
+    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent);
+};
+
+#endif // DRAWMAPSCENE_H