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

#include <color_preview.hpp>

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

Classes

class  Private
 

Public Types

enum  DisplayMode { NoAlpha, AllAlpha, SplitAlpha, SplitColor }
 

Public Slots

void setColor (const QColor &c)
 Set current color. More...
 
void setComparisonColor (const QColor &c)
 Set the comparison color. More...
 

Signals

void clicked ()
 Emitted when the user clicks on the widget. More...
 
void colorChanged (QColor)
 Emitted on setColor. More...
 

Public Member Functions

QBrush background () const
 Get the background visible under transparent colors. More...
 
QColor color () const
 Get current color. More...
 
 ColorPreview (QWidget *parent=0)
 
QColor comparisonColor () const
 Get the comparison color. More...
 
DisplayMode displayMode () const
 Get color display mode. More...
 
void paint (QPainter &painter, QRect rect) const
 
void setBackground (const QBrush &bk)
 Change the background visible under transparent colors. More...
 
void setDisplayMode (DisplayMode dm)
 Set how transparent colors are handled. More...
 
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
 

Detailed Description

Simple widget that shows a preview of a color

Definition at line 33 of file color_preview.hpp.

Member Enumeration Documentation

Enumerator
NoAlpha 

Show current color with no transparency.

AllAlpha 

show current color with transparency

SplitAlpha 

Show both solid and transparent side by side.

SplitColor 

Show current and comparison colors side by side.

Definition at line 42 of file color_preview.hpp.

Constructor & Destructor Documentation

color_widgets::ColorPreview::ColorPreview ( QWidget *  parent = 0)
explicit

Definition at line 45 of file color_preview.cpp.

color_widgets::ColorPreview::~ColorPreview ( )

Definition at line 51 of file color_preview.cpp.

Member Function Documentation

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.

ColorPreview::DisplayMode color_widgets::ColorPreview::displayMode ( ) const

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.

void color_widgets::ColorPreview::setDisplayMode ( DisplayMode  dm)

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.

Member Data Documentation

Private* const color_widgets::ColorPreview::p
private

Definition at line 96 of file color_preview.hpp.

Property Documentation

QBrush color_widgets::ColorPreview::background
readwrite

Definition at line 39 of file color_preview.hpp.

QColor color_widgets::ColorPreview::color
readwrite

Definition at line 36 of file color_preview.hpp.

QColor color_widgets::ColorPreview::comparisonColor
readwrite

Definition at line 37 of file color_preview.hpp.

DisplayMode color_widgets::ColorPreview::display_mode
readwrite

Definition at line 38 of file color_preview.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