-
Notifications
You must be signed in to change notification settings - Fork 0
/
algebraicdialog.h
82 lines (66 loc) · 1.5 KB
/
algebraicdialog.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
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
81
82
#ifndef ALGEBRAICDIALOG_H
#define ALGEBRAICDIALOG_H
#include <QWidget>
#include <QDialog>
#include <QJsonObject>
QT_BEGIN_NAMESPACE
class QAbstractButton;
class QButtonGroup;
class QImage;
class QLabel;
class QStackedWidget;
class QLineEdit;
class QGroupBox;
QT_END_NAMESPACE
class AddContent : public QWidget
{
Q_OBJECT
public:
AddContent(QWidget *parent = 0);
bool isDefault();
void getParams(double &, double &);
void setGroupName(QString str);
private slots:
void checkBoxClicked(bool);
private:
QLineEdit *img1Para;
QLineEdit *img2Para;
QGroupBox *addGroupBox;
bool defaultSetting;
};
class SubtractContent : public QWidget
{
public:
SubtractContent(QWidget *parent = 0);
};
class MultiplyContent : public QWidget
{
public:
MultiplyContent(QWidget *parent = 0);
};
class AlgebraicDialog : public QDialog
{
Q_OBJECT
public:
enum OperatorState{ADD = 0, SUBTRACT, MULTIPLY};
AlgebraicDialog(QWidget *parent, QImage src);
signals:
void sendApplyAlgebraicOperation(QJsonObject, QImage);
private slots:
void operatorButtonClicked(QAbstractButton*);
void openFile();
void apply();
private:
bool loadFile(const QString &);
QButtonGroup *btnGroup;
QStackedWidget *operatorPages;
OperatorState op;
QImage img1;
QImage img2;
QLabel *operatedImgLabel;
QLabel *operatedImgSizeLabel;
AddContent *addContent;
SubtractContent *subtractContent;
MultiplyContent *multiplyContent;
};
#endif // ALGEBRAICDIALOG_H