QGIS API Documentation  3.6.0-Noosa (5873452)
Signals | Public Member Functions | List of all members
QgsColorWidgetAction Class Reference

An action containing a color widget, which can be embedded into a menu. More...

#include <qgscolorwidgets.h>

Inheritance diagram for QgsColorWidgetAction:
Inheritance graph
[legend]

Signals

void colorChanged (const QColor &color)
 Emitted when a color has been selected from the widget. More...
 

Public Member Functions

 QgsColorWidgetAction (QgsColorWidget *colorWidget, QMenu *menu=nullptr, QWidget *parent=nullptr)
 Construct a new color widget action. More...
 
QgsColorWidgetcolorWidget ()
 Returns the color widget contained in the widget action. More...
 
bool dismissOnColorSelection () const
 Returns whether the parent menu will be dismissed after a color is selected from the action's color widget. More...
 
void setDismissOnColorSelection (bool dismiss)
 Sets whether the parent menu should be dismissed and closed when a color is selected from the action's color widget. More...
 

Detailed Description

An action containing a color widget, which can be embedded into a menu.

See also
QgsColorWidget
Since
QGIS 2.14

Definition at line 213 of file qgscolorwidgets.h.

Constructor & Destructor Documentation

◆ QgsColorWidgetAction()

QgsColorWidgetAction::QgsColorWidgetAction ( QgsColorWidget colorWidget,
QMenu *  menu = nullptr,
QWidget *  parent = nullptr 
)

Construct a new color widget action.

Parameters
colorWidgetQgsColorWidget to show in action
menuparent menu
parentparent widget

Definition at line 1680 of file qgscolorwidgets.cpp.

Member Function Documentation

◆ colorChanged

void QgsColorWidgetAction::colorChanged ( const QColor &  color)
signal

Emitted when a color has been selected from the widget.

Parameters
colorselected color

◆ colorWidget()

QgsColorWidget* QgsColorWidgetAction::colorWidget ( )
inline

Returns the color widget contained in the widget action.

Definition at line 230 of file qgscolorwidgets.h.

◆ dismissOnColorSelection()

bool QgsColorWidgetAction::dismissOnColorSelection ( ) const
inline

Returns whether the parent menu will be dismissed after a color is selected from the action's color widget.

See also
setDismissOnColorSelection

Definition at line 247 of file qgscolorwidgets.h.

◆ setDismissOnColorSelection()

void QgsColorWidgetAction::setDismissOnColorSelection ( bool  dismiss)
inline

Sets whether the parent menu should be dismissed and closed when a color is selected from the action's color widget.

Parameters
dismissset to true (default) to immediately close the menu when a color is selected from the widget. If set to false, the colorChanged signal will be emitted but the menu will stay open.
See also
dismissOnColorSelection()

Definition at line 240 of file qgscolorwidgets.h.


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