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

A widget drawing a palette. More...

#include <swatch.hpp>

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

Classes

class  Private
 

Public Types

enum  ColorSizePolicy { Hint, Minimum, Fixed }
 

Public Slots

void clearSelection ()
 
void removeSelected ()
 Remove the currently seleceted color. More...
 
void setBorder (const QPen &border)
 
void setColorSize (const QSize &colorSize)
 
void setColorSizePolicy (ColorSizePolicy colorSizePolicy)
 
void setForcedColumns (int forcedColumns)
 
void setForcedRows (int forcedRows)
 
void setPalette (const ColorPalette &palette)
 
void setReadOnly (bool readOnly)
 
void setSelected (int selected)
 

Signals

void borderChanged (const QPen &border)
 
void colorSelected (const QColor &color)
 
void colorSizeChanged (const QSize &colorSize)
 
void colorSizePolicyChanged (ColorSizePolicy colorSizePolicy)
 
void doubleClicked (int index)
 
void forcedColumnsChanged (int forcedColumns)
 
void forcedRowsChanged (int forcedRows)
 
void paletteChanged (const ColorPalette &palette)
 
void readOnlyChanged (bool readOnly)
 
void rightClicked (int index)
 
void selectedChanged (int selected)
 

Public Member Functions

QPen border () const
 
QColor colorAt (const QPoint &p)
 Color at the given position within the widget. More...
 
QSize colorSize () const
 
ColorSizePolicy colorSizePolicy () const
 
int forcedColumns () const
 
int forcedRows () const
 
int indexAt (const QPoint &p)
 Color index at the given position within the widget. More...
 
QSize minimumSizeHint () const Q_DECL_OVERRIDE
 
const ColorPalettepalette () const
 
ColorPalettepalette ()
 
bool readOnly () const
 
int selected () const
 
QColor selectedColor () const
 Color at the currently selected index. More...
 
QSize sizeHint () const Q_DECL_OVERRIDE
 
 Swatch (QWidget *parent=0)
 
 ~Swatch ()
 

Protected Slots

void paletteModified ()
 Connected to the internal palette object to keep eveything consistent. More...
 

Protected Member Functions

void dragEnterEvent (QDragEnterEvent *event) Q_DECL_OVERRIDE
 
void dragLeaveEvent (QDragLeaveEvent *event) Q_DECL_OVERRIDE
 
void dragMoveEvent (QDragMoveEvent *event) Q_DECL_OVERRIDE
 
void dropEvent (QDropEvent *event) Q_DECL_OVERRIDE
 
bool event (QEvent *event) Q_DECL_OVERRIDE
 
void keyPressEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 
void mouseDoubleClickEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 
void mouseMoveEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 
void mousePressEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 
void mouseReleaseEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 
void paintEvent (QPaintEvent *event) Q_DECL_OVERRIDE
 
void wheelEvent (QWheelEvent *event) Q_DECL_OVERRIDE
 

Properties

QPen border
 Border around the colors. More...
 
QSize colorSize
 Preferred size for a color square. More...
 
ColorSizePolicy colorSizePolicy
 
int forcedColumns
 Forces the Swatch to display that many columns of colors. More...
 
int forcedRows
 Forces the Swatch to display that many rows of colors. More...
 
const ColorPalette palette
 Palette shown by the widget. More...
 
bool readOnly
 Whether the palette can be modified via user interaction. More...
 
int selected
 Currently selected color (-1 if no color is selected) More...
 

Private Attributes

Privatep
 

Detailed Description

A widget drawing a palette.

Definition at line 34 of file swatch.hpp.

Member Enumeration Documentation

Enumerator
Hint 

The size is just a hint.

Minimum 

Can expand but not contract.

Fixed 

Must be exactly as specified.

Definition at line 91 of file swatch.hpp.

Constructor & Destructor Documentation

color_widgets::Swatch::Swatch ( QWidget *  parent = 0)

Definition at line 210 of file swatch.cpp.

color_widgets::Swatch::~Swatch ( )

Definition at line 230 of file swatch.cpp.

Member Function Documentation

QPen color_widgets::Swatch::border ( ) const
void color_widgets::Swatch::borderChanged ( const QPen &  border)
signal
void color_widgets::Swatch::clearSelection ( )
slot

Definition at line 321 of file swatch.cpp.

QColor color_widgets::Swatch::colorAt ( const QPoint &  p)

Color at the given position within the widget.

Parameters
pPoint in local coordinates

Definition at line 294 of file swatch.cpp.

void color_widgets::Swatch::colorSelected ( const QColor &  color)
signal
QSize color_widgets::Swatch::colorSize ( ) const
void color_widgets::Swatch::colorSizeChanged ( const QSize &  colorSize)
signal
ColorSizePolicy color_widgets::Swatch::colorSizePolicy ( ) const
void color_widgets::Swatch::colorSizePolicyChanged ( ColorSizePolicy  colorSizePolicy)
signal
void color_widgets::Swatch::doubleClicked ( int  index)
signal
void color_widgets::Swatch::dragEnterEvent ( QDragEnterEvent *  event)
protected

Definition at line 573 of file swatch.cpp.

void color_widgets::Swatch::dragLeaveEvent ( QDragLeaveEvent *  event)
protected

Definition at line 598 of file swatch.cpp.

void color_widgets::Swatch::dragMoveEvent ( QDragMoveEvent *  event)
protected

Definition at line 591 of file swatch.cpp.

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

Definition at line 603 of file swatch.cpp.

bool color_widgets::Swatch::event ( QEvent *  event)
protected

Definition at line 740 of file swatch.cpp.

int color_widgets::Swatch::forcedColumns ( ) const
void color_widgets::Swatch::forcedColumnsChanged ( int  forcedColumns)
signal
int color_widgets::Swatch::forcedRows ( ) const
void color_widgets::Swatch::forcedRowsChanged ( int  forcedRows)
signal
int color_widgets::Swatch::indexAt ( const QPoint &  p)

Color index at the given position within the widget.

Parameters
pPoint in local coordinates
Returns
-1 if the position doesn't represent any color

Definition at line 275 of file swatch.cpp.

void color_widgets::Swatch::keyPressEvent ( QKeyEvent *  event)
protected

Definition at line 399 of file swatch.cpp.

QSize color_widgets::Swatch::minimumSizeHint ( ) const

Definition at line 248 of file swatch.cpp.

void color_widgets::Swatch::mouseDoubleClickEvent ( QMouseEvent *  event)
protected

Definition at line 552 of file swatch.cpp.

void color_widgets::Swatch::mouseMoveEvent ( QMouseEvent *  event)
protected

Definition at line 520 of file swatch.cpp.

void color_widgets::Swatch::mousePressEvent ( QMouseEvent *  event)
protected

Definition at line 504 of file swatch.cpp.

void color_widgets::Swatch::mouseReleaseEvent ( QMouseEvent *  event)
protected

Definition at line 544 of file swatch.cpp.

void color_widgets::Swatch::paintEvent ( QPaintEvent *  event)
protected

Definition at line 326 of file swatch.cpp.

const ColorPalette& color_widgets::Swatch::palette ( ) const
ColorPalette& color_widgets::Swatch::palette ( )
void color_widgets::Swatch::paletteChanged ( const ColorPalette palette)
signal
void color_widgets::Swatch::paletteModified ( )
protectedslot

Connected to the internal palette object to keep eveything consistent.

Definition at line 652 of file swatch.cpp.

bool color_widgets::Swatch::readOnly ( ) const
void color_widgets::Swatch::readOnlyChanged ( bool  readOnly)
signal
void color_widgets::Swatch::removeSelected ( )
slot

Remove the currently seleceted color.

Definition at line 494 of file swatch.cpp.

void color_widgets::Swatch::rightClicked ( int  index)
signal
int color_widgets::Swatch::selected ( ) const
void color_widgets::Swatch::selectedChanged ( int  selected)
signal
QColor color_widgets::Swatch::selectedColor ( ) const

Color at the currently selected index.

Definition at line 270 of file swatch.cpp.

void color_widgets::Swatch::setBorder ( const QPen &  border)
slot

Definition at line 774 of file swatch.cpp.

void color_widgets::Swatch::setColorSize ( const QSize &  colorSize)
slot

Definition at line 670 of file swatch.cpp.

void color_widgets::Swatch::setColorSizePolicy ( ColorSizePolicy  colorSizePolicy)
slot

Definition at line 681 of file swatch.cpp.

void color_widgets::Swatch::setForcedColumns ( int  forcedColumns)
slot

Definition at line 702 of file swatch.cpp.

void color_widgets::Swatch::setForcedRows ( int  forcedRows)
slot

Definition at line 714 of file swatch.cpp.

void color_widgets::Swatch::setPalette ( const ColorPalette palette)
slot

Definition at line 299 of file swatch.cpp.

void color_widgets::Swatch::setReadOnly ( bool  readOnly)
slot

Definition at line 731 of file swatch.cpp.

void color_widgets::Swatch::setSelected ( int  selected)
slot

Definition at line 307 of file swatch.cpp.

QSize color_widgets::Swatch::sizeHint ( ) const

Definition at line 235 of file swatch.cpp.

void color_widgets::Swatch::wheelEvent ( QWheelEvent *  event)
protected

Definition at line 562 of file swatch.cpp.

Member Data Documentation

Private* color_widgets::Swatch::p
private

Definition at line 188 of file swatch.hpp.

Property Documentation

QPen color_widgets::Swatch::border
readwrite

Border around the colors.

Definition at line 57 of file swatch.hpp.

QSize color_widgets::Swatch::colorSize
readwrite

Preferred size for a color square.

Definition at line 50 of file swatch.hpp.

Swatch::ColorSizePolicy color_widgets::Swatch::colorSizePolicy
readwrite

Definition at line 52 of file swatch.hpp.

int color_widgets::Swatch::forcedColumns
readwrite

Forces the Swatch to display that many columns of colors.

If there are too few elements, the widget will display less than this many columns.

A value of 0 means that the number of columns is automatic.

Note
Conflicts with forcedRows

Definition at line 81 of file swatch.hpp.

int color_widgets::Swatch::forcedRows
readwrite

Forces the Swatch to display that many rows of colors.

If there are too few elements, the widget will display less than this many rows.

A value of0 means that the number of rows is automatic.

Note
Conflicts with forcedColumns

Definition at line 69 of file swatch.hpp.

ColorPalette & color_widgets::Swatch::palette
readwrite

Palette shown by the widget.

Definition at line 41 of file swatch.hpp.

bool color_widgets::Swatch::readOnly
readwrite

Whether the palette can be modified via user interaction.

Note
Even when this is false, it can still be altered programmatically

Definition at line 87 of file swatch.hpp.

int color_widgets::Swatch::selected
readwrite

Currently selected color (-1 if no color is selected)

Definition at line 45 of file swatch.hpp.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:19