-
Notifications
You must be signed in to change notification settings - Fork 0
/
QCADView.h
54 lines (44 loc) · 1.33 KB
/
QCADView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <QWidget>
class MEntity;
class MCommand;
//ÍźĐÎĘÓ´°
class QCADView :
public QWidget
{
private:
QList<MEntity*> m_EntityList;
QList<MEntity*> m_SelectEntityList;
MCommand* m_pCmd;
public:
QCADView();
~QCADView();
protected:
void paintEvent(QPaintEvent* event) override;
void mousePressEvent(QMouseEvent* mouseEvent);
void mouseMoveEvent(QMouseEvent* mouseEvent);
void mouseReleaseEvent(QMouseEvent* mouseEvent);
void mouseDoubleClickEvent(QMouseEvent* mouseEvent);
public:
void addEntity(MEntity* pEnt);
void drawLine();
void selectEntity();
private:
QColor m_lineColor;
Qt::PenStyle m_penStyle;
qreal m_penWidth;
QColor m_brushColor;
public:
void setLineColor(QColor color) { m_lineColor = color; }
void setPenStyle(Qt::PenStyle style) { m_penStyle = style; }
void setPenWidth(qreal width) { m_penWidth = width; }
void setBrushColor(QColor color) { m_brushColor = color; }
QColor lineColor() { return m_lineColor; }
Qt::PenStyle penStyle() { return m_penStyle; }
qreal penWidth() { return m_penWidth; }
QColor brushColor() { return m_brushColor; }
public:
void AddSelection(MEntity* pEnt);
void ClearSelections() { m_SelectEntityList.clear(); }
QList<MEntity*> GetEntityList() const { return m_EntityList; }
};