-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshapeobjecteditor.h
More file actions
80 lines (63 loc) · 1.81 KB
/
shapeobjecteditor.h
File metadata and controls
80 lines (63 loc) · 1.81 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef SHAPEOBJECTEDITOR_H
#define SHAPEOBJECTEDITOR_H
#include <QMainWindow>
#include <QApplication>
#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
#include <QtMath>
#include <QActionGroup>
#include "shape.h"
#include "rect.h"
#include "line.h"
#include "ellipse.h"
#include "dot.h"
#include "lineellipse.h"
#include "cube.h"
QT_BEGIN_NAMESPACE
namespace Ui { class ShapeObjectEditor; }
QT_END_NAMESPACE
class ShapeObjectEditor : public QMainWindow{
Q_OBJECT
public:
~ShapeObjectEditor();
static ShapeObjectEditor * getInstance(QWidget *parent = nullptr);
protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void closeEvent(QCloseEvent *event) override;
void drawing(QPainter *painter);
void deleting();
QPainter *painterForWidget;
QPoint pressPoint;
QPoint movePoint;
bool isDraw = false;
bool isRel;
bool isShapeChecked = false;
bool isDebug = true;
static const int arraySize = 128;
int counter = 0;
Shape *shapeArray[arraySize];
int cubeLength=40;
int cubeCoef=0;
private slots:
void on_actionopenTab_triggered();
void on_openTableCoord_triggered();
public slots:
void cubeSizeGetter(int cubeLength,int cubeCoef);
signals:
void sendShapeTable(QString, QPoint, QPoint);
void widgetClose();
void widgetOpenTablet();
void widgetOpenResize();
private:
static ShapeObjectEditor* p_instance;
ShapeObjectEditor(QWidget *parent = nullptr);
ShapeObjectEditor() {};
ShapeObjectEditor( const ShapeObjectEditor& );
ShapeObjectEditor& operator=(const ShapeObjectEditor& );
Ui::ShapeObjectEditor *ui;
};
#endif // SHAPEOBJECTEDITOR_H