A custom QGIS widget for selecting a color, including options for selecting colors via hue wheel, color swatches, and a color sampler.
More...
#include <qgscompoundcolorwidget.h>
|
void | setColor (const QColor &color) |
| Sets the current color for the dialog.
|
|
void | setPreviousColor (const QColor &color) |
| Sets the color to show in an optional "previous color" section.
|
|
void | acceptPanel () |
| Accept the panel.
|
|
void | openPanel (QgsPanelWidget *panel) |
| Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the showPanel signal for connected slots to handle the open event.
|
|
|
| QgsCompoundColorWidget (QWidget *parent=nullptr, const QColor &color=QColor(), Layout layout=LayoutDefault) |
| Constructor for QgsCompoundColorWidget.
|
|
| ~QgsCompoundColorWidget () override |
|
QColor | color () const |
| Returns the current color for the dialog.
|
|
void | setAllowOpacity (bool allowOpacity) |
| Sets whether opacity modification (transparency) is permitted for the color dialog.
|
|
void | setColorModelEditable (bool colorModelEditable) |
| Sets whether color model is editable or not.
|
|
void | setDiscarded (bool discarded) |
| Sets whether the widget's color has been "discarded" and the selected color should not be stored in the recent color list.
|
|
| QgsPanelWidget (QWidget *parent=nullptr) |
| Base class for any widget that can be shown as a inline panel.
|
|
virtual bool | applySizeConstraintsToStack () const |
| Returns true if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.
|
|
bool | autoDelete () |
| The the auto delete property on the widget.
|
|
void | connectChildPanel (QgsPanelWidget *panel) |
| Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.
|
|
void | connectChildPanels (const QList< QgsPanelWidget * > &panels) |
| Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.
|
|
bool | dockMode () |
| Returns the dock mode state.
|
|
virtual QMenu * | menuButtonMenu () |
| Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required.
|
|
virtual QString | menuButtonTooltip () const |
| Returns the (translated) tooltip text to use for the menu button for this panel.
|
|
QString | panelTitle () |
| The title of the panel.
|
|
void | setAutoDelete (bool autoDelete) |
| The the auto delete property on the widget.
|
|
virtual void | setDockMode (bool dockMode) |
| Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
|
|
void | setPanelTitle (const QString &panelTitle) |
| Set the title of the panel when shown in the interface.
|
|
A custom QGIS widget for selecting a color, including options for selecting colors via hue wheel, color swatches, and a color sampler.
Definition at line 34 of file qgscompoundcolorwidget.h.
◆ Layout
Widget layout.
Enumerator |
---|
LayoutDefault | Use the default (rectangular) layout.
|
LayoutVertical | Use a narrower, vertically stacked layout.
|
Definition at line 40 of file qgscompoundcolorwidget.h.
◆ QgsCompoundColorWidget()
QgsCompoundColorWidget::QgsCompoundColorWidget |
( |
QWidget * |
parent = nullptr , |
|
|
const QColor & |
color = QColor() , |
|
|
Layout |
layout = LayoutDefault |
|
) |
| |
◆ ~QgsCompoundColorWidget()
QgsCompoundColorWidget::~QgsCompoundColorWidget |
( |
| ) |
|
|
override |
◆ color()
QColor QgsCompoundColorWidget::color |
( |
| ) |
const |
◆ createNewUserPalette()
◆ currentColorChanged
void QgsCompoundColorWidget::currentColorChanged |
( |
const QColor & |
color | ) |
|
|
signal |
Emitted when the dialog's color changes.
- Parameters
-
◆ hideEvent()
void QgsCompoundColorWidget::hideEvent |
( |
QHideEvent * |
e | ) |
|
|
overrideprotected |
◆ importUserPaletteFromFile()
QgsUserColorScheme * QgsCompoundColorWidget::importUserPaletteFromFile |
( |
QWidget * |
parent | ) |
|
|
static |
◆ keyPressEvent()
void QgsCompoundColorWidget::keyPressEvent |
( |
QKeyEvent * |
e | ) |
|
|
overrideprotected |
◆ mouseMoveEvent()
void QgsCompoundColorWidget::mouseMoveEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotected |
◆ mousePressEvent()
void QgsCompoundColorWidget::mousePressEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotected |
◆ mouseReleaseEvent()
void QgsCompoundColorWidget::mouseReleaseEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotected |
◆ removeUserPalette()
bool QgsCompoundColorWidget::removeUserPalette |
( |
QgsUserColorScheme * |
scheme, |
|
|
QWidget * |
parent |
|
) |
| |
|
static |
◆ setAllowOpacity()
void QgsCompoundColorWidget::setAllowOpacity |
( |
bool |
allowOpacity | ) |
|
Sets whether opacity modification (transparency) is permitted for the color dialog.
Defaults to true
.
- Parameters
-
allowOpacity | set to false to disable opacity modification |
Definition at line 334 of file qgscompoundcolorwidget.cpp.
◆ setColor
void QgsCompoundColorWidget::setColor |
( |
const QColor & |
color | ) |
|
|
slot |
◆ setColorModelEditable()
void QgsCompoundColorWidget::setColorModelEditable |
( |
bool |
colorModelEditable | ) |
|
Sets whether color model is editable or not.
- Parameters
-
colorModelEditable | set to false to disable color model modification Defaults to true . |
- Since
- QGIS 3.40
Definition at line 347 of file qgscompoundcolorwidget.cpp.
◆ setDiscarded()
void QgsCompoundColorWidget::setDiscarded |
( |
bool |
discarded | ) |
|
|
inline |
Sets whether the widget's color has been "discarded" and the selected color should not be stored in the recent color list.
- Parameters
-
discarded | set to true to avoid adding color to recent color list on widget destruction. |
Definition at line 82 of file qgscompoundcolorwidget.h.
◆ setPreviousColor
void QgsCompoundColorWidget::setPreviousColor |
( |
const QColor & |
color | ) |
|
|
slot |
◆ TestQgsCompoundColorWidget
friend class TestQgsCompoundColorWidget |
|
friend |
The documentation for this class was generated from the following files: