PlotterHMI/datafile/view/mygraphicsscene.h

42 lines
1.0 KiB
C
Raw Normal View History

2024-02-06 06:19:53 +00:00
#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 createScenePathAndPic(QPainterPath path,QPicture pic);
void addItemToScene();
2024-02-06 06:19:53 +00:00
void cleanScene();
QPicture getPictureByDat(Marker marker,int penWidth = 1);
QPicture getPictureByBmp(QPixmap pixmap,int penWidth = 1);
QPainterPath getDrawPath();
void swithSceneByPic(QPicture pic);
void swithSceneByPath(QPainterPath path);
2024-02-06 06:19:53 +00:00
void ReflushBlockScene(QPoint p);
signals:
public slots:
};
#endif // MYGRAPHICSSCENE_H