forked from frankyeh/DSI-Studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqcolorcombobox.h
43 lines (33 loc) · 923 Bytes
/
qcolorcombobox.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
#ifndef QCOLORCOMBOBOX_H
#define QCOLORCOMBOBOX_H
#include <QComboBox>
#include <QToolButton>
class QColorComboBox : public QComboBox
{
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor USER true)
public:
QColorComboBox(QWidget *widget = 0):QComboBox(widget){populateList();}
public:
QColor color() const;
void setColor(QColor c);
private:
void populateList();
};
class QColorToolButton : public QToolButton
{
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor USER true)
public:
QColorToolButton(QWidget *widget = 0):QToolButton(widget)
{
setToolButtonStyle(Qt::ToolButtonTextOnly);
}
void mouseReleaseEvent ( QMouseEvent * e );
public:
QColor color() const;
void setColor(QColor color);
private:
QColor selected_color;
};
#endif // QCOLORCOMBOBOX_H