Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
color_widgets
include
color_preview.hpp
Go to the documentation of this file.
1
23
#ifndef COLOR_PREVIEW_HPP
24
#define COLOR_PREVIEW_HPP
25
26
#include <QWidget>
27
28
namespace
color_widgets
{
29
33
class
ColorPreview
:
public
QWidget
34
{
35
Q_OBJECT
36
Q_PROPERTY(QColor
color
READ
color
WRITE
setColor
NOTIFY
colorChanged
DESIGNABLE
true
)
37
Q_PROPERTY(QColor
comparisonColor
READ
comparisonColor
WRITE
setComparisonColor
DESIGNABLE true)
38
Q_PROPERTY(
DisplayMode
display_mode
READ
displayMode
WRITE
setDisplayMode
DESIGNABLE true)
39
Q_PROPERTY(QBrush
background
READ
background
WRITE
setBackground
DESIGNABLE true)
40
Q_ENUMS(
DisplayMode
)
41
public:
42
enum
DisplayMode
43
{
44
NoAlpha
,
45
AllAlpha
,
46
SplitAlpha
,
47
SplitColor
48
};
49
50
explicit
ColorPreview
(QWidget *parent = 0);
51
~ColorPreview
();
52
54
QBrush
background
()
const
;
55
57
void
setBackground
(
const
QBrush &bk);
58
60
DisplayMode
displayMode
()
const
;
61
63
void
setDisplayMode
(
DisplayMode
dm);
64
66
QColor
color
()
const
;
67
69
QColor
comparisonColor
()
const
;
70
71
QSize
sizeHint
()
const
;
72
73
void
paint
(QPainter &painter, QRect rect)
const
;
74
75
public
slots:
77
void
setColor
(
const
QColor &c);
78
80
void
setComparisonColor
(
const
QColor &c);
81
82
signals:
84
void
clicked
();
85
87
void
colorChanged
(QColor);
88
89
protected
:
90
void
paintEvent
(QPaintEvent *);
91
void
resizeEvent
(QResizeEvent *);
92
void
mouseReleaseEvent
(QMouseEvent *ev);
93
void
mouseMoveEvent
(QMouseEvent *ev);
94
95
private
:
96
class
Private
;
97
Private
*
const
p
;
98
};
99
100
}
// namespace color_widgets
101
102
#endif // COLOR_PREVIEW_HPP
color_widgets::ColorPreview::comparisonColor
QColor comparisonColor() const
Get the comparison color.
color_widgets::ColorPreview::~ColorPreview
~ColorPreview()
Definition:
color_preview.cpp:51
color_widgets::ColorPreview::displayMode
DisplayMode displayMode() const
Get color display mode.
Definition:
color_preview.cpp:67
color_widgets::ColorPreview::Private
Definition:
color_preview.cpp:33
color_widgets::ColorPreview::setColor
void setColor(const QColor &c)
Set current color.
Definition:
color_preview.cpp:131
color_widgets::ColorPreview::colorChanged
void colorChanged(QColor)
Emitted on setColor.
color_widgets::ColorPreview::DisplayMode
DisplayMode
Definition:
color_preview.hpp:42
color_widgets::ColorPreview::setBackground
void setBackground(const QBrush &bk)
Change the background visible under transparent colors.
Definition:
color_preview.cpp:56
color_widgets::ColorPreview::paint
void paint(QPainter &painter, QRect rect) const
Definition:
color_preview.cpp:93
color_widgets::ColorPreview::SplitAlpha
Show both solid and transparent side by side.
Definition:
color_preview.hpp:46
color_widgets::ColorPreview::display_mode
DisplayMode display_mode
Definition:
color_preview.hpp:38
color_widgets::ColorPreview::sizeHint
QSize sizeHint() const
Definition:
color_preview.cpp:88
color_widgets::ColorPreview::resizeEvent
void resizeEvent(QResizeEvent *)
Definition:
color_preview.cpp:151
color_widgets::ColorPreview::paintEvent
void paintEvent(QPaintEvent *)
Definition:
color_preview.cpp:144
color_widgets::ColorPreview::AllAlpha
show current color with transparency
Definition:
color_preview.hpp:45
color_widgets::ColorPreview::SplitColor
Show current and comparison colors side by side.
Definition:
color_preview.hpp:47
color_widgets::ColorPreview::clicked
void clicked()
Emitted when the user clicks on the widget.
color_widgets::ColorPreview
Definition:
color_preview.hpp:33
color_widgets::ColorPreview::ColorPreview
ColorPreview(QWidget *parent=0)
Definition:
color_preview.cpp:45
color_widgets::ColorPreview::color
QColor color() const
Get current color.
color_widgets::ColorPreview::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *ev)
Definition:
color_preview.cpp:156
color_widgets::ColorPreview::NoAlpha
Show current color with no transparency.
Definition:
color_preview.hpp:44
color_widgets::ColorPreview::p
Private *const p
Definition:
color_preview.hpp:96
color_widgets::ColorPreview::setDisplayMode
void setDisplayMode(DisplayMode dm)
Set how transparent colors are handled.
Definition:
color_preview.cpp:72
color_widgets::ColorPreview::background
QBrush background() const
Get the background visible under transparent colors.
color_widgets
Definition:
color_dialog.hpp:33
color_widgets::ColorPreview::setComparisonColor
void setComparisonColor(const QColor &c)
Set the comparison color.
Definition:
color_preview.cpp:138
color_widgets::ColorPreview::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *ev)
Definition:
color_preview.cpp:162
plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17