-
Notifications
You must be signed in to change notification settings - Fork 0
/
photoeditorwindow.h
144 lines (121 loc) · 4.58 KB
/
photoeditorwindow.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef PHOTOEDITORWINDOW_H
#define PHOTOEDITORWINDOW_H
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#include <QToolBar>
#include <QToolButton>
#include <QPushButton>
#include <QButtonGroup>
#include <QLabel>
#include <QSlider>
#include <QLineEdit>
#include <QComboBox>
#include <QColorDialog>
#include <QScrollArea>
#include <QImage>
#include <QVBoxLayout>
class PhotoEditorWindow : public QMainWindow
{
Q_OBJECT
public:
enum DrawTools {
PencilDrawTool = 0,
ArrowDrawTool,
BoxDrawTool,
EllipseDrawTool,
TriangleDrawTool,
StarDrawTool
};
PhotoEditorWindow(QWidget *parent = nullptr);
~PhotoEditorWindow();
public slots:
void openFile();
private slots:
bool loadPhoto(const QString& filePath);
private:
void init();
void createWidgets();
void createLayout();
void createConnections();
QString fileMenuToolButtonStyleSheet();
QString fileMenuStyleSheet();
QString titleIconToolButtonStyleSheet();
QString titleToolButtonStyleSheet();
QString systemToolButtonStyleSheet();
QString closeSystemToolButtonStyleSheet();
QString toolButtonStyleSheet();
QString pushButtonStyleSheet(const QString& normalIconUrl,
const QString& hoverIconUrl = QString(),
const QString& pressedIconUrl = QString(),
const QString& disabledIconUrl = QString());
QString checkableDrawToolButtonStyleSheet(const QString& normalIconUrl,
const QString& pressedIconUrl = QString());
QString opacityLineEditStyleSheet();
QString opacitySliderStyleSheet();
QString roundToolButtonStyleSheet();
QString roundComboboxStyleSheet();
QString photoScrollAreaStyleSheet();
// --------------------------------------------------------------------------
// Title toolbar
QToolBar* m_titleToolBar { nullptr };
QLabel* m_titleLabel { nullptr };
QToolButton* m_titleIconButton { nullptr };
QToolButton* m_settingsButton { nullptr };
QToolButton* m_helpButton { nullptr };
QToolButton* m_minimizeButton { nullptr };
QToolButton* m_maximizeButton { nullptr };
QToolButton* m_closeButton { nullptr };
// --------------------------------------------------------------------------
// Header toolbar
QToolBar* m_headerToolBar { nullptr };
QToolButton* m_fileMenuToolButton { nullptr };
QMenu* m_fileMenu { nullptr };
QAction* m_openFileAction { nullptr };
QAction* m_saveFileAction { nullptr };
QAction* m_saveAsFileAction { nullptr };
QAction* m_printAction { nullptr };
QToolButton* m_undoButton { nullptr };
QToolButton* m_redoButton { nullptr };
QToolButton* m_resetButton { nullptr };
QPushButton* m_copyButton { nullptr };
// --------------------------------------------------------------------------
// Draw Tools bar
QWidget* m_drawToolsSidePanel { nullptr };
QWidget* m_drawToolsPanel { nullptr };
QLabel* m_drawToolsLabel { nullptr };
QButtonGroup* m_drawToolsButtonGroup { nullptr };
QToolBar* m_drawToolsBar { nullptr };
QToolButton* m_pencilDrawToolButton { nullptr };
QToolButton* m_arrowDrawToolButton { nullptr };
QToolButton* m_boxDrawToolButton { nullptr };
QToolButton* m_ellipseDrawToolButton { nullptr };
QToolButton* m_triangleDrawToolButton { nullptr };
QToolButton* m_starDrawToolButton { nullptr };
// --------------------------------------------------------------------------
// Draw Tools Settings bar
QWidget* m_drawToolsSettingsPanel { nullptr };
QLabel* m_opacityLabel { nullptr };
QSlider* m_opacitySlider { nullptr };
QLineEdit* m_opacityLineEdit { nullptr };
QLabel* m_outlineColorLabel { nullptr };
QToolButton* m_pipetteToolButton { nullptr };
QColorDialog* m_colorDialog { nullptr };
QComboBox* m_colorCombobox { nullptr };
QPalette m_defaultSystemPalette;
// --------------------------------------------------------------------------
// Photo zone
QImage m_photo;
QLabel *m_photoLabel { nullptr };
QScrollArea *m_photoScrollArea { nullptr };
// --------------------------------------------------------------------------
// Footer toolbar
QToolBar* m_footerToolBar { nullptr };
// --------------------------------------------------------------------------
// Photo Editor window
QWidget* m_centralWidget { nullptr };
QVBoxLayout* m_mainLayout { nullptr };
double m_scaleFactor { 1.0 };
};
#endif // PHOTOEDITORWINDOW_H