QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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.
 

Public Member Functions

 QgsColorWidgetAction (QgsColorWidget *colorWidget, QMenu *menu=nullptr, QWidget *parent=nullptr)
 Construct a new color widget action.
 
QgsColorWidgetcolorWidget ()
 Returns the color widget contained in the widget action.
 
bool dismissOnColorSelection () const
 Returns whether the parent menu will be dismissed after a color is selected from the action's color widget.
 
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.
 

Detailed Description

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

See also
QgsColorWidget

Definition at line 299 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 1883 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 316 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 333 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 326 of file qgscolorwidgets.h.


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