A widget drawing a palette. More...
#include <swatch.hpp>
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 ColorPalette & | palette () const |
| ColorPalette & | palette () |
| 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 | |
| Private * | p |
A widget drawing a palette.
Definition at line 34 of file swatch.hpp.
| 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.
| color_widgets::Swatch::Swatch | ( | QWidget * | parent = 0 | ) |
Definition at line 210 of file swatch.cpp.
Definition at line 230 of file swatch.cpp.
| 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.
| p | Point 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] |
| 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.
| p | Point in local coordinates |
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 |
| 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.
| 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.
Private* color_widgets::Swatch::p [private] |
Definition at line 188 of file swatch.hpp.
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.
int color_widgets::Swatch::forcedColumns [read, write] |
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.
Definition at line 81 of file swatch.hpp.
int color_widgets::Swatch::forcedRows [read, write] |
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.
Definition at line 69 of file swatch.hpp.
ColorPalette & color_widgets::Swatch::palette [read, write] |
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.
Definition at line 87 of file swatch.hpp.
int color_widgets::Swatch::selected [read, write] |
Currently selected color (-1 if no color is selected)
Definition at line 45 of file swatch.hpp.