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:
|
2024-03-08 08:33:05 +00:00
|
|
|
void addItemToScene();
|
2024-02-06 06:19:53 +00:00
|
|
|
void cleanScene();
|
2024-03-22 07:58:53 +00:00
|
|
|
CreatPictureStr getPictureByDat(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
|
|
|
CreatPictureStr getPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
2024-03-08 08:33:05 +00:00
|
|
|
void swithSceneByPic(QPicture pic);
|
2024-03-22 07:58:53 +00:00
|
|
|
void reflushBlockScene(QPoint p);
|
2024-02-06 06:19:53 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MYGRAPHICSSCENE_H
|