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

A widget drawing a palette. More...

#include <swatch.hpp>

List of all members.

Classes

class  Private

Public Types

enum  ColorSizePolicy { Hint, Minimum, Fixed }

Public Slots

void clearSelection ()
void removeSelected ()
 Remove the currently seleceted color.
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.
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.
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.
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.

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

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.

Definition at line 230 of file swatch.cpp.


Member Function Documentation

void color_widgets::Swatch::borderChanged ( const QPen &  border) [signal]

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]
void color_widgets::Swatch::colorSizeChanged ( const QSize &  colorSize) [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.

void color_widgets::Swatch::forcedColumnsChanged ( int  forcedColumns) [signal]
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.

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.

void color_widgets::Swatch::paletteChanged ( const ColorPalette palette) [signal]
void color_widgets::Swatch::paletteModified ( ) [protected, slot]

Connected to the internal palette object to keep eveything consistent.

Definition at line 652 of file swatch.cpp.

void color_widgets::Swatch::readOnlyChanged ( bool  readOnly) [signal]

Remove the currently seleceted color.

Definition at line 494 of file swatch.cpp.

void color_widgets::Swatch::rightClicked ( int  index) [signal]
void color_widgets::Swatch::selectedChanged ( int  selected) [signal]

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.

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.

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

Definition at line 188 of file swatch.hpp.


Property Documentation

QPen color_widgets::Swatch::border [read, write]

Border around the colors.

Definition at line 57 of file swatch.hpp.

QSize color_widgets::Swatch::colorSize [read, write]

Preferred size for a color square.

Definition at line 50 of file swatch.hpp.

Definition at line 52 of file swatch.hpp.

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.

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.

Palette shown by the widget.

Definition at line 41 of file swatch.hpp.

bool color_widgets::Swatch::readOnly [read, write]

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.

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 Fri Sep 1 2017 02:41:58