BALL
1.5.0
Loading...
Searching...
No Matches
include
BALL
VIEW
WIDGETS
colorButton.h
Go to the documentation of this file.
1
#ifndef BALL_VIEW_WIDGETS_COLORBUTTON_H
2
#define BALL_VIEW_WIDGETS_COLORBUTTON_H
3
4
#ifndef BALL_COMMON_GLOBAL_
5
# include <
BALL/COMMON/global.h
>
6
#endif
7
8
#include <QtWidgets/QPushButton>
9
#include <QtGui/QColor>
10
11
class
QPaintEvent;
12
13
namespace
BALL
14
{
15
namespace
VIEW
16
{
17
class
ColorRGBA
;
18
19
class
BALL_VIEW_EXPORT
ColorButton
:
public
QPushButton
20
{
21
Q_OBJECT
22
Q_PROPERTY (QColor
color_
READ
getColor
WRITE
setColor
USER
true
)
23
Q_PROPERTY (QColor
default_color_
READ
getDefaultColor
WRITE
setDefaultColor
)
24
25
public:
26
explicit
ColorButton
(
QWidget
* parent);
27
explicit
ColorButton
(const QColor& color,
QWidget
* parent);
28
explicit
ColorButton
(const QColor& color, const QColor& default_color,
QWidget
* parent);
29
explicit
ColorButton
(const
ColorRGBA
& color,
QWidget
* parent);
30
explicit
ColorButton
(const
ColorRGBA
& color, const
ColorRGBA
& defaultColor,
QWidget
* parent);
31
32
virtual ~
ColorButton
();
33
34
void
setColor
(const QColor& color);
35
void
setColor
(const
ColorRGBA
& color);
36
const QColor&
getColor
() const;
37
38
void
setDefaultColor
(const QColor& color);
39
void
setDefaultColor
(const
ColorRGBA
& color);
40
const QColor&
getDefaultColor
() const;
41
42
void
setEnableAlpha
(
bool
enable);
43
bool
isAlphaEnabled
() const;
44
45
QSize
sizeHint
() const;
46
47
public Q_SLOTS:
48
void
chooseColor
();
49
50
Q_SIGNALS:
51
void
colorChanged
(QColor color);
52
53
protected:
54
QColor
color_
;
55
QColor
default_color_
;
56
57
bool
enable_alpha_
;
58
59
virtual
void
paintEvent
(QPaintEvent* evt);
60
61
private:
62
void
setup_();
63
};
64
}
65
}
66
67
#endif
//BALL_VIEW_WIDGETS_COLORBUTTON_H
global.h
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition
COMMON/global.h:52
BALL::VIEW::ColorButton::ColorButton
ColorButton(QWidget *parent)
BALL::VIEW::ColorButton::paintEvent
virtual void paintEvent(QPaintEvent *evt)
BALL::VIEW::ColorButton::getColor
const QColor & getColor() const
BALL::VIEW::ColorButton::color_
QColor color_
Definition
colorButton.h:22
BALL::VIEW::ColorButton::sizeHint
QSize sizeHint() const
BALL::VIEW::ColorButton::default_color_
QColor default_color_
Definition
colorButton.h:23
BALL::VIEW::ColorButton::setDefaultColor
void setDefaultColor(const QColor &color)
BALL::VIEW::ColorButton::enable_alpha_
bool enable_alpha_
Definition
colorButton.h:57
BALL::VIEW::ColorButton::setColor
void setColor(const QColor &color)
BALL::VIEW::ColorButton::getDefaultColor
const QColor & getDefaultColor() const
BALL::VIEW::ColorButton::isAlphaEnabled
bool isAlphaEnabled() const
BALL::VIEW::ColorButton::chooseColor
void chooseColor()
BALL::VIEW::ColorButton::setEnableAlpha
void setEnableAlpha(bool enable)
BALL::VIEW::ColorButton::colorChanged
void colorChanged(QColor color)
BALL::VIEW::ColorRGBA
Definition
colorRGBA.h:32
QPushButton
QWidget
BALL::VIEW
Definition
constraints.h:35
BALL
Definition
constants.h:13
Generated by
1.15.0