39 lines
875 B
C++
39 lines
875 B
C++
#ifndef MYGRAPHICSSCENE_H
|
|
#define MYGRAPHICSSCENE_H
|
|
|
|
#include <QObject>
|
|
#include <QGraphicsScene>
|
|
#include "datafile/view/mygraphicsitem.h"
|
|
|
|
#define DRAWMARGINS 200.0 //item在场景中绘制时的边距(留边)
|
|
|
|
class MyGraphicsScene: public QGraphicsScene
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
MyGraphicsScene();
|
|
~MyGraphicsScene();
|
|
|
|
protected:
|
|
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
|
|
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
|
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent);
|
|
|
|
private:
|
|
MyGraphicsItem *m_myGraphicsItem;
|
|
|
|
public:
|
|
void createScene(Marker marker);
|
|
void createScene(QPixmap pixmap);
|
|
void cleanScene();
|
|
QPicture getPicture(Marker marker,int penWidth = 1);
|
|
void swithScene(QPicture pic);
|
|
void ReflushBlockScene(QPoint p);
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
};
|
|
|
|
#endif // MYGRAPHICSSCENE_H
|