-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcolordialog.h
More file actions
39 lines (29 loc) · 717 Bytes
/
colordialog.h
File metadata and controls
39 lines (29 loc) · 717 Bytes
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
#ifndef COLORDIALOG_H
#define COLORDIALOG_H
#include <QDialog>
#include <QMouseEvent>
class ColorDialog : public QDialog
{
Q_OBJECT
public:
explicit ColorDialog(QWidget *parent = Q_NULLPTR);
private:
struct RectStruct
{
QRect rect;
QString color;
};
QList<RectStruct> m_rectList;
int m_hovered;
QString m_currentColor;
void paintEvent(QPaintEvent *);
void resizeEvent(QResizeEvent *);
void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
int getHitedRect(const QPoint &pos);
signals:
void currentColor(const QString &color);
public slots:
QString getColor(){return m_currentColor;}
};
#endif // COLORDIALOG_H