Display an analog widget that allows the selection of a HSV color. More...
#include <color_wheel.hpp>

Classes | |
| class | Private |
Public Types | |
| enum | DisplayEnum { SHAPE_DEFAULT = 0x000, SHAPE_TRIANGLE = 0x001, SHAPE_SQUARE = 0x002, SHAPE_FLAGS = 0x00f, ANGLE_DEFAULT = 0x000, ANGLE_FIXED = 0x010, ANGLE_ROTATING = 0x020, ANGLE_FLAGS = 0x0f0, COLOR_DEFAULT = 0x000, COLOR_HSV = 0x100, COLOR_HSL = 0x200, COLOR_LCH = 0x400, COLOR_FLAGS = 0xf00, FLAGS_DEFAULT = 0x000, FLAGS_ALL = 0xfff } |
Public Slots | |
| void | setColor (QColor c) |
| Set current color. More... | |
| void | setDisplayFlags (ColorWheel::DisplayFlags flags) |
| Set the display flags. More... | |
| void | setHue (qreal h) |
| void | setSaturation (qreal s) |
| void | setValue (qreal v) |
Signals | |
| void | colorChanged (QColor) |
| void | colorSelected (QColor) |
| void | displayFlagsChanged (ColorWheel::DisplayFlags flags) |
Public Member Functions | |
| QColor | color () const |
| Get current color. More... | |
| ColorWheel (QWidget *parent=0) | |
| DisplayFlags | displayFlags (DisplayFlags mask=FLAGS_ALL) const |
| Get display flags. More... | |
| qreal | hue () const |
| Get current hue in the range [0-1]. More... | |
| qreal | saturation () const |
| Get current saturation in the range [0-1]. More... | |
| void | setDisplayFlag (DisplayFlags flag, DisplayFlags mask) |
| Set a specific display flag. More... | |
| void | setWheelWidth (unsigned int w) |
| Set the width in pixels of the outer wheel. More... | |
| QSize | sizeHint () const Q_DECL_OVERRIDE |
| qreal | value () const |
| Get current value in the range [0-1]. More... | |
| unsigned int | wheelWidth () const |
| Get the width in pixels of the outer wheel. More... | |
| ~ColorWheel () | |
Static Public Member Functions | |
| static DisplayFlags | defaultDisplayFlags (DisplayFlags mask=FLAGS_ALL) |
| Get default display flags. More... | |
| static void | setDefaultDisplayFlags (DisplayFlags flags) |
| Set the default display flags. More... | |
Protected Member Functions | |
| void | dragEnterEvent (QDragEnterEvent *event) Q_DECL_OVERRIDE |
| void | dropEvent (QDropEvent *event) Q_DECL_OVERRIDE |
| void | mouseMoveEvent (QMouseEvent *) Q_DECL_OVERRIDE |
| void | mousePressEvent (QMouseEvent *) Q_DECL_OVERRIDE |
| void | mouseReleaseEvent (QMouseEvent *) Q_DECL_OVERRIDE |
| void | paintEvent (QPaintEvent *) Q_DECL_OVERRIDE |
| void | resizeEvent (QResizeEvent *) Q_DECL_OVERRIDE |
Properties | |
| QColor | color |
| DisplayFlags | displayFlags |
| qreal | hue |
| unsigned wheelWidth | READ |
| qreal | saturation |
| qreal | value |
Private Attributes | |
| Private *const | p |
Display an analog widget that allows the selection of a HSV color.
It has an outer wheel to select the Hue and an intenal square to select Saturation and Lightness.
Definition at line 35 of file color_wheel.hpp.
Definition at line 47 of file color_wheel.hpp.
|
explicit |
Definition at line 248 of file color_wheel.cpp.
| color_widgets::ColorWheel::~ColorWheel | ( | ) |
Definition at line 255 of file color_wheel.cpp.
| QColor color_widgets::ColorWheel::color | ( | ) | const |
Get current color.
|
signal |
Emitted when the user selects a color or setColor is called
|
signal |
Emitted when the user selects a color
|
static |
Get default display flags.
Definition at line 526 of file color_wheel.cpp.
| ColorWheel::DisplayFlags color_widgets::ColorWheel::displayFlags | ( | DisplayFlags | mask = FLAGS_ALL | ) | const |
Get display flags.
Definition at line 510 of file color_wheel.cpp.
|
signal |
|
protected |
Definition at line 536 of file color_wheel.cpp.
|
protected |
Definition at line 543 of file color_wheel.cpp.
| qreal color_widgets::ColorWheel::hue | ( | ) | const |
Get current hue in the range [0-1].
|
protected |
Definition at line 361 of file color_wheel.cpp.
|
protected |
Definition at line 407 of file color_wheel.cpp.
|
protected |
Definition at line 423 of file color_wheel.cpp.
|
protected |
Definition at line 299 of file color_wheel.cpp.
|
protected |
Definition at line 429 of file color_wheel.cpp.
| qreal color_widgets::ColorWheel::saturation | ( | ) | const |
Get current saturation in the range [0-1].
|
slot |
Set current color.
Definition at line 435 of file color_wheel.cpp.
|
static |
Set the default display flags.
Definition at line 515 of file color_wheel.cpp.
| void color_widgets::ColorWheel::setDisplayFlag | ( | DisplayFlags | flag, |
| DisplayFlags | mask | ||
| ) |
Set a specific display flag.
| flag | Flag replacing the mask |
| mask | Mask to be cleared |
Definition at line 531 of file color_wheel.cpp.
|
slot |
Set the display flags.
| flags | which will replace the current ones |
Definition at line 465 of file color_wheel.cpp.
|
slot |
| h | Hue [0-1] |
Definition at line 445 of file color_wheel.cpp.
|
slot |
| s | Saturation [0-1] |
Definition at line 452 of file color_wheel.cpp.
|
slot |
| v | Value [0-1] |
Definition at line 458 of file color_wheel.cpp.
| void color_widgets::ColorWheel::setWheelWidth | ( | unsigned int | w | ) |
Set the width in pixels of the outer wheel.
Definition at line 292 of file color_wheel.cpp.
| QSize color_widgets::ColorWheel::sizeHint | ( | ) | const |
Definition at line 265 of file color_wheel.cpp.
| qreal color_widgets::ColorWheel::value | ( | ) | const |
Get current value in the range [0-1].
| unsigned int color_widgets::ColorWheel::wheelWidth | ( | ) | const |
Get the width in pixels of the outer wheel.
Definition at line 287 of file color_wheel.cpp.
|
private |
Definition at line 159 of file color_wheel.hpp.
|
readwrite |
Definition at line 39 of file color_wheel.hpp.
|
readwrite |
Definition at line 44 of file color_wheel.hpp.
|
readwrite |
Definition at line 40 of file color_wheel.hpp.
|
write |
Definition at line 43 of file color_wheel.hpp.
|
readwrite |
Definition at line 41 of file color_wheel.hpp.
|
readwrite |
Definition at line 42 of file color_wheel.hpp.