Classes | Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Private Attributes
color_widgets::ColorWheel Class Reference

Display an analog widget that allows the selection of a HSV color. More...

#include <color_wheel.hpp>

List of all members.

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.
void setDisplayFlags (ColorWheel::DisplayFlags flags)
 Set the display flags.
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.
 ColorWheel (QWidget *parent=0)
DisplayFlags displayFlags (DisplayFlags mask=FLAGS_ALL) const
 Get display flags.
qreal hue () const
 Get current hue in the range [0-1].
qreal saturation () const
 Get current saturation in the range [0-1].
void setDisplayFlag (DisplayFlags flag, DisplayFlags mask)
 Set a specific display flag.
void setWheelWidth (unsigned int w)
 Set the width in pixels of the outer wheel.
QSize sizeHint () const Q_DECL_OVERRIDE
qreal value () const
 Get current value in the range [0-1].
unsigned int wheelWidth () const
 Get the width in pixels of the outer wheel.
 ~ColorWheel ()

Static Public Member Functions

static DisplayFlags defaultDisplayFlags (DisplayFlags mask=FLAGS_ALL)
 Get default display flags.
static void setDefaultDisplayFlags (DisplayFlags flags)
 Set the default display flags.

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
qreal saturation
qreal value
unsigned wheelWidth

Private Attributes

Private *const p

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
SHAPE_DEFAULT 

Use the default shape.

SHAPE_TRIANGLE 

A triangle.

SHAPE_SQUARE 

A square.

SHAPE_FLAGS 

Mask for the shape flags.

ANGLE_DEFAULT 

Use the default rotation style.

ANGLE_FIXED 

The inner part doesn't rotate.

ANGLE_ROTATING 

The inner part follows the hue selector.

ANGLE_FLAGS 

Mask for the angle flags.

COLOR_DEFAULT 

Use the default colorspace.

COLOR_HSV 

Use the HSV color space.

COLOR_HSL 

Use the HSL color space.

COLOR_LCH 

Use Luma Chroma Hue (Y_601')

COLOR_FLAGS 

Mask for the color space flags.

FLAGS_DEFAULT 

Use all defaults.

FLAGS_ALL 

Mask matching all flags.

Definition at line 47 of file color_wheel.hpp.


Constructor & Destructor Documentation

color_widgets::ColorWheel::ColorWheel ( QWidget *  parent = 0) [explicit]

Definition at line 247 of file color_wheel.cpp.

Definition at line 254 of file color_wheel.cpp.


Member Function Documentation

Get current color.

void color_widgets::ColorWheel::colorChanged ( QColor  ) [signal]

Emitted when the user selects a color or setColor is called

void color_widgets::ColorWheel::colorSelected ( QColor  ) [signal]

Emitted when the user selects a color

ColorWheel::DisplayFlags color_widgets::ColorWheel::defaultDisplayFlags ( DisplayFlags  mask = FLAGS_ALL) [static]

Get default display flags.

Definition at line 525 of file color_wheel.cpp.

ColorWheel::DisplayFlags color_widgets::ColorWheel::displayFlags ( DisplayFlags  mask = FLAGS_ALL) const

Get display flags.

Definition at line 509 of file color_wheel.cpp.

void color_widgets::ColorWheel::displayFlagsChanged ( ColorWheel::DisplayFlags  flags) [signal]
void color_widgets::ColorWheel::dragEnterEvent ( QDragEnterEvent *  event) [protected]

Definition at line 535 of file color_wheel.cpp.

void color_widgets::ColorWheel::dropEvent ( QDropEvent *  event) [protected]

Definition at line 542 of file color_wheel.cpp.

Get current hue in the range [0-1].

void color_widgets::ColorWheel::mouseMoveEvent ( QMouseEvent *  ev) [protected]

Definition at line 360 of file color_wheel.cpp.

void color_widgets::ColorWheel::mousePressEvent ( QMouseEvent *  ev) [protected]

Definition at line 406 of file color_wheel.cpp.

void color_widgets::ColorWheel::mouseReleaseEvent ( QMouseEvent *  ev) [protected]

Definition at line 422 of file color_wheel.cpp.

void color_widgets::ColorWheel::paintEvent ( QPaintEvent *  ) [protected]

Definition at line 298 of file color_wheel.cpp.

void color_widgets::ColorWheel::resizeEvent ( QResizeEvent *  ) [protected]

Definition at line 428 of file color_wheel.cpp.

Get current saturation in the range [0-1].

void color_widgets::ColorWheel::setColor ( QColor  c) [slot]

Set current color.

Definition at line 434 of file color_wheel.cpp.

void color_widgets::ColorWheel::setDefaultDisplayFlags ( DisplayFlags  flags) [static]

Set the default display flags.

Definition at line 514 of file color_wheel.cpp.

void color_widgets::ColorWheel::setDisplayFlag ( DisplayFlags  flag,
DisplayFlags  mask 
)

Set a specific display flag.

Parameters:
flagFlag replacing the mask
maskMask to be cleared

Definition at line 530 of file color_wheel.cpp.

void color_widgets::ColorWheel::setDisplayFlags ( ColorWheel::DisplayFlags  flags) [slot]

Set the display flags.

Parameters:
flagswhich will replace the current ones

Definition at line 464 of file color_wheel.cpp.

void color_widgets::ColorWheel::setHue ( qreal  h) [slot]
Parameters:
hHue [0-1]

Definition at line 444 of file color_wheel.cpp.

void color_widgets::ColorWheel::setSaturation ( qreal  s) [slot]
Parameters:
sSaturation [0-1]

Definition at line 451 of file color_wheel.cpp.

void color_widgets::ColorWheel::setValue ( qreal  v) [slot]
Parameters:
vValue [0-1]

Definition at line 457 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 291 of file color_wheel.cpp.

Definition at line 264 of file color_wheel.cpp.

Get current value in the range [0-1].

unsigned int color_widgets::ColorWheel::wheelWidth ( ) const

Get the width in pixels of the outer wheel.


Member Data Documentation

Definition at line 159 of file color_wheel.hpp.


Property Documentation

QColor color_widgets::ColorWheel::color [read, write]

Definition at line 39 of file color_wheel.hpp.

DisplayFlags color_widgets::ColorWheel::displayFlags [read, write]

Definition at line 44 of file color_wheel.hpp.

qreal color_widgets::ColorWheel::hue [read, write]

Definition at line 40 of file color_wheel.hpp.

Definition at line 41 of file color_wheel.hpp.

qreal color_widgets::ColorWheel::value [read, write]

Definition at line 42 of file color_wheel.hpp.

unsigned int color_widgets::ColorWheel::wheelWidth [read, write]

Definition at line 43 of file color_wheel.hpp.


The documentation for this class was generated from the following files:


plotjuggler
Author(s): Davide Faconti
autogenerated on Wed Jul 3 2019 19:28:06