A widget drawing a palette.
More...
#include <swatch.hpp>
A widget drawing a palette.
Definition at line 34 of file swatch.hpp.
◆ ColorSizePolicy
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.
◆ Swatch()
color_widgets::Swatch::Swatch |
( |
QWidget * |
parent = 0 | ) |
|
◆ ~Swatch()
color_widgets::Swatch::~Swatch |
( |
| ) |
|
◆ border()
QPen color_widgets::Swatch::border |
( |
| ) |
const |
◆ borderChanged
void color_widgets::Swatch::borderChanged |
( |
const QPen & |
border | ) |
|
|
signal |
◆ clearSelection
void color_widgets::Swatch::clearSelection |
( |
| ) |
|
|
slot |
◆ colorAt()
QColor color_widgets::Swatch::colorAt |
( |
const QPoint & |
p | ) |
|
Color at the given position within the widget.
- Parameters
-
p | Point in local coordinates |
Definition at line 294 of file swatch.cpp.
◆ colorSelected
void color_widgets::Swatch::colorSelected |
( |
const QColor & |
color | ) |
|
|
signal |
◆ colorSize()
QSize color_widgets::Swatch::colorSize |
( |
| ) |
const |
◆ colorSizeChanged
void color_widgets::Swatch::colorSizeChanged |
( |
const QSize & |
colorSize | ) |
|
|
signal |
◆ colorSizePolicy()
◆ colorSizePolicyChanged
void color_widgets::Swatch::colorSizePolicyChanged |
( |
ColorSizePolicy |
colorSizePolicy | ) |
|
|
signal |
◆ doubleClicked
void color_widgets::Swatch::doubleClicked |
( |
int |
index | ) |
|
|
signal |
◆ dragEnterEvent()
void color_widgets::Swatch::dragEnterEvent |
( |
QDragEnterEvent * |
event | ) |
|
|
protected |
◆ dragLeaveEvent()
void color_widgets::Swatch::dragLeaveEvent |
( |
QDragLeaveEvent * |
event | ) |
|
|
protected |
◆ dragMoveEvent()
void color_widgets::Swatch::dragMoveEvent |
( |
QDragMoveEvent * |
event | ) |
|
|
protected |
◆ dropEvent()
void color_widgets::Swatch::dropEvent |
( |
QDropEvent * |
event | ) |
|
|
protected |
◆ event()
bool color_widgets::Swatch::event |
( |
QEvent * |
event | ) |
|
|
protected |
◆ forcedColumns()
int color_widgets::Swatch::forcedColumns |
( |
| ) |
const |
◆ forcedColumnsChanged
void color_widgets::Swatch::forcedColumnsChanged |
( |
int |
forcedColumns | ) |
|
|
signal |
◆ forcedRows()
int color_widgets::Swatch::forcedRows |
( |
| ) |
const |
◆ forcedRowsChanged
void color_widgets::Swatch::forcedRowsChanged |
( |
int |
forcedRows | ) |
|
|
signal |
◆ indexAt()
int color_widgets::Swatch::indexAt |
( |
const QPoint & |
p | ) |
|
Color index at the given position within the widget.
- Parameters
-
p | Point in local coordinates |
- Returns
- -1 if the position doesn't represent any color
Definition at line 275 of file swatch.cpp.
◆ keyPressEvent()
void color_widgets::Swatch::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
protected |
◆ minimumSizeHint()
QSize color_widgets::Swatch::minimumSizeHint |
( |
| ) |
const |
◆ mouseDoubleClickEvent()
void color_widgets::Swatch::mouseDoubleClickEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
◆ mouseMoveEvent()
void color_widgets::Swatch::mouseMoveEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
◆ mousePressEvent()
void color_widgets::Swatch::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
◆ mouseReleaseEvent()
void color_widgets::Swatch::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
◆ paintEvent()
void color_widgets::Swatch::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
protected |
◆ palette() [1/2]
◆ palette() [2/2]
const ColorPalette& color_widgets::Swatch::palette |
( |
| ) |
const |
◆ paletteChanged
void color_widgets::Swatch::paletteChanged |
( |
const ColorPalette & |
palette | ) |
|
|
signal |
◆ paletteModified
void color_widgets::Swatch::paletteModified |
( |
| ) |
|
|
protectedslot |
Connected to the internal palette object to keep eveything consistent.
Definition at line 652 of file swatch.cpp.
◆ readOnly()
bool color_widgets::Swatch::readOnly |
( |
| ) |
const |
◆ readOnlyChanged
void color_widgets::Swatch::readOnlyChanged |
( |
bool |
readOnly | ) |
|
|
signal |
◆ removeSelected
void color_widgets::Swatch::removeSelected |
( |
| ) |
|
|
slot |
Remove the currently seleceted color.
Definition at line 494 of file swatch.cpp.
◆ rightClicked
void color_widgets::Swatch::rightClicked |
( |
int |
index | ) |
|
|
signal |
◆ selected()
int color_widgets::Swatch::selected |
( |
| ) |
const |
◆ selectedChanged
void color_widgets::Swatch::selectedChanged |
( |
int |
selected | ) |
|
|
signal |
◆ selectedColor()
QColor color_widgets::Swatch::selectedColor |
( |
| ) |
const |
Color at the currently selected index.
Definition at line 270 of file swatch.cpp.
◆ setBorder
void color_widgets::Swatch::setBorder |
( |
const QPen & |
border | ) |
|
|
slot |
◆ setColorSize
void color_widgets::Swatch::setColorSize |
( |
const QSize & |
colorSize | ) |
|
|
slot |
◆ setColorSizePolicy
void color_widgets::Swatch::setColorSizePolicy |
( |
ColorSizePolicy |
colorSizePolicy | ) |
|
|
slot |
◆ setForcedColumns
void color_widgets::Swatch::setForcedColumns |
( |
int |
forcedColumns | ) |
|
|
slot |
◆ setForcedRows
void color_widgets::Swatch::setForcedRows |
( |
int |
forcedRows | ) |
|
|
slot |
◆ setPalette
void color_widgets::Swatch::setPalette |
( |
const ColorPalette & |
palette | ) |
|
|
slot |
◆ setReadOnly
void color_widgets::Swatch::setReadOnly |
( |
bool |
readOnly | ) |
|
|
slot |
◆ setSelected
void color_widgets::Swatch::setSelected |
( |
int |
selected | ) |
|
|
slot |
◆ sizeHint()
QSize color_widgets::Swatch::sizeHint |
( |
| ) |
const |
◆ wheelEvent()
void color_widgets::Swatch::wheelEvent |
( |
QWheelEvent * |
event | ) |
|
|
protected |
◆ border
QPen color_widgets::Swatch::border |
|
readwrite |
Border around the colors.
Definition at line 57 of file swatch.hpp.
◆ colorSize
QSize color_widgets::Swatch::colorSize |
|
readwrite |
Preferred size for a color square.
Definition at line 50 of file swatch.hpp.
◆ colorSizePolicy
◆ forcedColumns
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.
◆ forcedRows
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.
◆ palette
Palette shown by the widget.
Definition at line 41 of file swatch.hpp.
◆ readOnly
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.
◆ selected
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: