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

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

#include <color_wheel.hpp>

Inheritance diagram for color_widgets::ColorWheel:
Inheritance graph
[legend]

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
 

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 248 of file color_wheel.cpp.

color_widgets::ColorWheel::~ColorWheel ( )

Definition at line 255 of file color_wheel.cpp.

Member Function Documentation

QColor color_widgets::ColorWheel::color ( ) const

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 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.

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

Definition at line 536 of file color_wheel.cpp.

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

Definition at line 543 of file color_wheel.cpp.

qreal color_widgets::ColorWheel::hue ( ) const

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

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

Definition at line 361 of file color_wheel.cpp.

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

Definition at line 407 of file color_wheel.cpp.

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

Definition at line 423 of file color_wheel.cpp.

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

Definition at line 299 of file color_wheel.cpp.

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

Definition at line 429 of file color_wheel.cpp.

qreal color_widgets::ColorWheel::saturation ( ) const

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

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

Set current color.

Definition at line 435 of file color_wheel.cpp.

void color_widgets::ColorWheel::setDefaultDisplayFlags ( DisplayFlags  flags)
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.

Parameters
flagFlag replacing the mask
maskMask to be cleared

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

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

Definition at line 445 of file color_wheel.cpp.

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

Definition at line 452 of file color_wheel.cpp.

void color_widgets::ColorWheel::setValue ( qreal  v)
slot
Parameters
vValue [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.

Member Data Documentation

Private* const color_widgets::ColorWheel::p
private

Definition at line 159 of file color_wheel.hpp.

Property Documentation

QColor color_widgets::ColorWheel::color
readwrite

Definition at line 39 of file color_wheel.hpp.

DisplayFlags color_widgets::ColorWheel::displayFlags
readwrite

Definition at line 44 of file color_wheel.hpp.

qreal color_widgets::ColorWheel::hue
readwrite

Definition at line 40 of file color_wheel.hpp.

unsigned wheelWidth color_widgets::ColorWheel::READ
write

Definition at line 43 of file color_wheel.hpp.

qreal color_widgets::ColorWheel::saturation
readwrite

Definition at line 41 of file color_wheel.hpp.

qreal color_widgets::ColorWheel::value
readwrite

Definition at line 42 of file color_wheel.hpp.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:51