#include <color_preview.hpp>
Classes | |
class | Private |
Public Types | |
enum | DisplayMode { NoAlpha, AllAlpha, SplitAlpha, SplitColor } |
Public Slots | |
void | setColor (const QColor &c) |
Set current color. | |
void | setComparisonColor (const QColor &c) |
Set the comparison color. | |
Signals | |
void | clicked () |
Emitted when the user clicks on the widget. | |
void | colorChanged (QColor) |
Emitted on setColor. | |
Public Member Functions | |
QBrush | background () const |
Get the background visible under transparent colors. | |
QColor | color () const |
Get current color. | |
ColorPreview (QWidget *parent=0) | |
QColor | comparisonColor () const |
Get the comparison color. | |
DisplayMode | displayMode () const |
Get color display mode. | |
void | paint (QPainter &painter, QRect rect) const |
void | setBackground (const QBrush &bk) |
Change the background visible under transparent colors. | |
void | setDisplayMode (DisplayMode dm) |
Set how transparent colors are handled. | |
QSize | sizeHint () const |
~ColorPreview () | |
Protected Member Functions | |
void | mouseMoveEvent (QMouseEvent *ev) |
void | mouseReleaseEvent (QMouseEvent *ev) |
void | paintEvent (QPaintEvent *) |
void | resizeEvent (QResizeEvent *) |
Properties | |
QBrush | background |
QColor | color |
QColor | comparisonColor |
DisplayMode | display_mode |
Private Attributes | |
Private *const | p |
Simple widget that shows a preview of a color
Definition at line 33 of file color_preview.hpp.
Definition at line 42 of file color_preview.hpp.
color_widgets::ColorPreview::ColorPreview | ( | QWidget * | parent = 0 | ) | [explicit] |
Definition at line 45 of file color_preview.cpp.
Definition at line 51 of file color_preview.cpp.
QBrush color_widgets::ColorPreview::background | ( | ) | const |
Get the background visible under transparent colors.
void color_widgets::ColorPreview::clicked | ( | ) | [signal] |
Emitted when the user clicks on the widget.
QColor color_widgets::ColorPreview::color | ( | ) | const |
Get current color.
void color_widgets::ColorPreview::colorChanged | ( | QColor | ) | [signal] |
Emitted on setColor.
QColor color_widgets::ColorPreview::comparisonColor | ( | ) | const |
Get the comparison color.
Get color display mode.
Definition at line 67 of file color_preview.cpp.
void color_widgets::ColorPreview::mouseMoveEvent | ( | QMouseEvent * | ev | ) | [protected] |
Definition at line 162 of file color_preview.cpp.
void color_widgets::ColorPreview::mouseReleaseEvent | ( | QMouseEvent * | ev | ) | [protected] |
Definition at line 156 of file color_preview.cpp.
void color_widgets::ColorPreview::paint | ( | QPainter & | painter, |
QRect | rect | ||
) | const |
Definition at line 93 of file color_preview.cpp.
void color_widgets::ColorPreview::paintEvent | ( | QPaintEvent * | ) | [protected] |
Definition at line 144 of file color_preview.cpp.
void color_widgets::ColorPreview::resizeEvent | ( | QResizeEvent * | ) | [protected] |
Definition at line 151 of file color_preview.cpp.
void color_widgets::ColorPreview::setBackground | ( | const QBrush & | bk | ) |
Change the background visible under transparent colors.
Definition at line 56 of file color_preview.cpp.
void color_widgets::ColorPreview::setColor | ( | const QColor & | c | ) | [slot] |
Set current color.
Definition at line 131 of file color_preview.cpp.
void color_widgets::ColorPreview::setComparisonColor | ( | const QColor & | c | ) | [slot] |
Set the comparison color.
Definition at line 138 of file color_preview.cpp.
Set how transparent colors are handled.
Definition at line 72 of file color_preview.cpp.
QSize color_widgets::ColorPreview::sizeHint | ( | ) | const |
Definition at line 88 of file color_preview.cpp.
Private* const color_widgets::ColorPreview::p [private] |
Reimplemented in color_widgets::ColorSelector.
Definition at line 96 of file color_preview.hpp.
QBrush color_widgets::ColorPreview::background [read, write] |
Definition at line 39 of file color_preview.hpp.
QColor color_widgets::ColorPreview::color [read, write] |
Definition at line 36 of file color_preview.hpp.
QColor color_widgets::ColorPreview::comparisonColor [read, write] |
Definition at line 37 of file color_preview.hpp.
DisplayMode color_widgets::ColorPreview::display_mode [read, write] |
Definition at line 38 of file color_preview.hpp.