QGIS API Documentation  3.0.2-Girona (307d082)
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsCompoundColorWidget Class Reference

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>

Inheritance diagram for QgsCompoundColorWidget:
Inheritance graph
[legend]

Public Types

enum  Layout { LayoutDefault = 0, LayoutVertical }
 Widget layout. More...
 

Public Slots

void setColor (const QColor &color)
 Sets the current color for the dialog. More...
 
void setPreviousColor (const QColor &color)
 Sets the color to show in an optional "previous color" section. More...
 
- Public Slots inherited from QgsPanelWidget
void acceptPanel ()
 Accept the panel. More...
 
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. More...
 

Signals

void currentColorChanged (const QColor &color)
 Emitted when the dialog's color changes. More...
 
- Signals inherited from QgsPanelWidget
void panelAccepted (QgsPanelWidget *panel)
 Emitted when the panel is accepted by the user. More...
 
void showPanel (QgsPanelWidget *panel)
 Emit when you require a panel to be show in the interface. More...
 
void widgetChanged ()
 Emitted when the widget state changes. More...
 

Public Member Functions

 QgsCompoundColorWidget (QWidget *parent=nullptr, const QColor &color=QColor(), Layout layout=LayoutDefault)
 Constructor for QgsCompoundColorWidget. More...
 
 ~QgsCompoundColorWidget () override
 
QColor color () const
 Returns the current color for the dialog. More...
 
void setAllowOpacity (const bool allowOpacity)
 Sets whether opacity modification (transparency) is permitted for the color dialog. More...
 
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. More...
 
- Public Member Functions inherited from QgsPanelWidget
 QgsPanelWidget (QWidget *parent=nullptr)
 Base class for any widget that can be shown as a inline panel. More...
 
bool autoDelete ()
 The the auto delete property on the widget. More...
 
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. More...
 
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. More...
 
bool dockMode ()
 Return the dock mode state. More...
 
QString panelTitle ()
 The title of the panel. More...
 
void setAutoDelete (bool autoDelete)
 The the auto delete property on the widget. More...
 
virtual void setDockMode (bool dockMode)
 Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs. More...
 
void setPanelTitle (const QString &panelTitle)
 Set the title of the panel when shown in the interface. More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *e) override
 
void mouseMoveEvent (QMouseEvent *e) override
 
void mousePressEvent (QMouseEvent *e) override
 
void mouseReleaseEvent (QMouseEvent *e) override
 
- Protected Member Functions inherited from QgsPanelWidget
void keyPressEvent (QKeyEvent *event) override
 Overridden key press event to handle the esc event on the widget. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QgsPanelWidget
static QgsPanelWidgetfindParentPanel (QWidget *widget)
 Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget. More...
 

Detailed Description

A custom QGIS widget for selecting a color, including options for selecting colors via hue wheel, color swatches, and a color sampler.

Since
QGIS 2.16

Definition at line 33 of file qgscompoundcolorwidget.h.

Member Enumeration Documentation

◆ Layout

Widget layout.

Enumerator
LayoutDefault 

Use the default (rectangular) layout.

LayoutVertical 

Use a narrower, vertically stacked layout.

Definition at line 41 of file qgscompoundcolorwidget.h.

Constructor & Destructor Documentation

◆ QgsCompoundColorWidget()

QgsCompoundColorWidget::QgsCompoundColorWidget ( QWidget *  parent = nullptr,
const QColor &  color = QColor(),
Layout  layout = LayoutDefault 
)

Constructor for QgsCompoundColorWidget.

Parameters
parentparent widget
colorinitial color for dialog
layoutwidget layout to use

Definition at line 35 of file qgscompoundcolorwidget.cpp.

◆ ~QgsCompoundColorWidget()

QgsCompoundColorWidget::~QgsCompoundColorWidget ( )
override

Definition at line 243 of file qgscompoundcolorwidget.cpp.

Member Function Documentation

◆ color()

QColor QgsCompoundColorWidget::color ( ) const

Returns the current color for the dialog.

Returns
dialog color

Definition at line 252 of file qgscompoundcolorwidget.cpp.

◆ currentColorChanged

void QgsCompoundColorWidget::currentColorChanged ( const QColor &  color)
signal

Emitted when the dialog's color changes.

Parameters
colorcurrent color

◆ keyPressEvent()

void QgsCompoundColorWidget::keyPressEvent ( QKeyEvent *  e)
overrideprotected

Definition at line 755 of file qgscompoundcolorwidget.cpp.

◆ mouseMoveEvent()

void QgsCompoundColorWidget::mouseMoveEvent ( QMouseEvent *  e)
overrideprotected

Definition at line 726 of file qgscompoundcolorwidget.cpp.

◆ mousePressEvent()

void QgsCompoundColorWidget::mousePressEvent ( QMouseEvent *  e)
overrideprotected

Definition at line 667 of file qgscompoundcolorwidget.cpp.

◆ mouseReleaseEvent()

void QgsCompoundColorWidget::mouseReleaseEvent ( QMouseEvent *  e)
overrideprotected

Definition at line 742 of file qgscompoundcolorwidget.cpp.

◆ setAllowOpacity()

void QgsCompoundColorWidget::setAllowOpacity ( const bool  allowOpacity)

Sets whether opacity modification (transparency) is permitted for the color dialog.

Defaults to true.

Parameters
allowOpacityset to false to disable opacity modification
Since
QGIS 3.0

Definition at line 259 of file qgscompoundcolorwidget.cpp.

◆ setColor

void QgsCompoundColorWidget::setColor ( const QColor &  color)
slot

Sets the current color for the dialog.

Parameters
colordesired color

Definition at line 634 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
discardedset to true to avoid adding color to recent color list on widget destruction.
Since
QGIS 3.0

Definition at line 77 of file qgscompoundcolorwidget.h.

◆ setPreviousColor

void QgsCompoundColorWidget::setPreviousColor ( const QColor &  color)
slot

Sets the color to show in an optional "previous color" section.

Parameters
colorprevious color

Definition at line 661 of file qgscompoundcolorwidget.cpp.


The documentation for this class was generated from the following files: