A preview box which displays one or two colors as swatches.
More...
#include <qgscolorwidgets.h>
|
virtual void | setColor2 (const QColor &color) |
| Sets the second color for the widget.
|
|
virtual void | setColor (const QColor &color, bool emitSignals=false) |
| Sets the color for the widget.
|
|
virtual void | setComponent (QgsColorWidget::ColorComponent component) |
| Sets the color component which the widget controls.
|
|
virtual Q_DECL_DEPRECATED void | setComponentValue (int value) |
| Alters the widget's color by setting the value for the widget's color component.
|
|
virtual void | setComponentValueF (float value) |
| Alters the widget's color by setting the value for the widget's color component.
|
|
|
enum | ColorComponent {
Multiple = 0
, Red
, Green
, Blue
,
Hue
, Saturation
, Value
, Alpha
,
Cyan
, Magenta
, Yellow
, Black
} |
| Specifies the color component which the widget alters. More...
|
|
enum class | ComponentUnit { Scaled0to255
, Percent
, Degree
} |
| Specified the color component unit. More...
|
|
void | colorChanged (const QColor &color) |
| Emitted when the widget's color changes.
|
|
void | hovered () |
| Emitted when mouse hovers over widget.
|
|
static ComponentUnit | componentUnit (ColorComponent component) |
| Returns color component unit.
|
|
static QPixmap | createDragIcon (const QColor &color) |
| Create an icon for dragging colors.
|
|
static Q_DECL_DEPRECATED void | alterColor (QColor &color, QgsColorWidget::ColorComponent component, int newValue) |
| Alters a color by modifying the value of a specific color component.
|
|
static void | alterColorF (QColor &color, QgsColorWidget::ColorComponent component, float newValue) |
| Alters a color by modifying the value of a specific color component.
|
|
static QColor::Spec | colorSpec (QgsColorWidget::ColorComponent component) |
| Returns component type of color, either RGB, HSV, CMYK, or Invalid if component value is Multiple or Alpha.
|
|
static int | componentRange (ColorComponent component) |
| Returns the range of valid values a color component.
|
|
static const QPixmap & | transparentBackground () |
| Generates a checkboard pattern pixmap for use as a background to transparent colors.
|
|
ColorComponent | mComponent |
|
QColor | mCurrentColor |
|
float | mExplicitHue = 0 |
| QColor wipes the hue information when it is ambiguous (e.g., for saturation = 0).
|
|
A preview box which displays one or two colors as swatches.
Definition at line 845 of file qgscolorwidgets.h.
◆ QgsColorPreviewWidget()
QgsColorPreviewWidget::QgsColorPreviewWidget |
( |
QWidget * |
parent = nullptr | ) |
|
Construct a new color preview widget.
- Parameters
-
parent | parent QWidget for the widget |
Definition at line 1732 of file qgscolorwidgets.cpp.
◆ color2()
QColor QgsColorPreviewWidget::color2 |
( |
| ) |
const |
|
inline |
Returns the secondary color for the widget.
- Returns
- secondary widget color, or an invalid color if the widget has no secondary color
- See also
- color
-
setColor2
Definition at line 867 of file qgscolorwidgets.h.
◆ mouseMoveEvent()
void QgsColorPreviewWidget::mouseMoveEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotected |
◆ mousePressEvent()
void QgsColorPreviewWidget::mousePressEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotected |
◆ mouseReleaseEvent()
void QgsColorPreviewWidget::mouseReleaseEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotected |
◆ paintEvent()
void QgsColorPreviewWidget::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
override |
◆ setColor2
void QgsColorPreviewWidget::setColor2 |
( |
const QColor & |
color | ) |
|
|
virtualslot |
Sets the second color for the widget.
- Parameters
-
color | secondary widget color. Set to an invalid color to prevent drawing of a secondary color |
- See also
- setColor
-
color2
Definition at line 1796 of file qgscolorwidgets.cpp.
◆ sizeHint()
QSize QgsColorPreviewWidget::sizeHint |
( |
| ) |
const |
|
override |
The documentation for this class was generated from the following files: