QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Slots | Signals | Public Member Functions | List of all members
QgsColorSwatchGridAction Class Reference

A color swatch grid which can be embedded into a menu. More...

#include <qgscolorswatchgrid.h>

Inheritance diagram for QgsColorSwatchGridAction:
Inheritance graph
[legend]

Public Slots

void refreshColors ()
 Reload colors from scheme and redraws the widget. More...
 

Signals

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

Public Member Functions

 QgsColorSwatchGridAction (QgsColorScheme *scheme, QMenu *menu=nullptr, const QString &context=QString(), QWidget *parent=nullptr)
 Construct a new color swatch grid action. More...
 
virtual ~QgsColorSwatchGridAction ()
 
QColor baseColor () const
 Get the base color for the color grid. More...
 
QString context () const
 Get the current context for the color grid. 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 setBaseColor (const QColor &baseColor)
 Sets the base color for the color grid. More...
 
void setContext (const QString &context)
 Sets the current context for the color grid. 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...
 
- Public Member Functions inherited from QWidgetAction
 QWidgetAction (QObject *parent)
 
virtual ~QWidgetAction ()
 
QWidgetdefaultWidget () const
 
void releaseWidget (QWidget *widget)
 
QWidgetrequestWidget (QWidget *parent)
 
void setDefaultWidget (QWidget *widget)
 
- Public Member Functions inherited from QAction
 QAction (QObject *parent)
 
 QAction (const QString &text, QObject *parent)
 
 QAction (QObject *parent, const char *name)
 
 QAction (const QString &text, const QKeySequence &shortcut, QObject *parent, const char *name)
 
 QAction (const QIcon &icon, const QString &text, QObject *parent)
 
 QAction (const QIcon &icon, const QString &text, const QKeySequence &shortcut, QObject *parent, const char *name)
 
 ~QAction ()
 
QKeySequence accel () const
 
QActionGroupactionGroup () const
 
void activate (ActionEvent event)
 
void activated (int i)
 
bool addTo (QWidget *w)
 
QList< QGraphicsWidget * > associatedGraphicsWidgets () const
 
QList< QWidget * > associatedWidgets () const
 
bool autoRepeat () const
 
void changed ()
 
QVariant data () const
 
QFont font () const
 
void hover ()
 
void hovered ()
 
QIcon icon () const
 
QIcon iconSet () const
 
QString iconText () const
 
bool isCheckable () const
 
bool isChecked () const
 
bool isEnabled () const
 
bool isIconVisibleInMenu () const
 
bool isOn () const
 
bool isSeparator () const
 
bool isToggleAction () const
 
bool isVisible () const
 
QMenumenu () const
 
MenuRole menuRole () const
 
QString menuText () const
 
QWidgetparentWidget () const
 
Priority priority () const
 
bool removeFrom (QWidget *w)
 
void setAccel (const QKeySequence &shortcut)
 
void setActionGroup (QActionGroup *group)
 
void setAutoRepeat (bool)
 
void setCheckable (bool)
 
void setChecked (bool)
 
void setData (const QVariant &userData)
 
void setDisabled (bool b)
 
void setEnabled (bool)
 
void setFont (const QFont &font)
 
void setIcon (const QIcon &icon)
 
void setIconSet (const QIcon &i)
 
void setIconText (const QString &text)
 
void setIconVisibleInMenu (bool visible)
 
void setMenu (QMenu *menu)
 
void setMenuRole (MenuRole menuRole)
 
void setMenuText (const QString &text)
 
void setOn (bool b)
 
void setPriority (Priority priority)
 
void setSeparator (bool b)
 
void setShortcut (const QKeySequence &shortcut)
 
void setShortcutContext (Qt::ShortcutContext context)
 
void setShortcuts (QKeySequence::StandardKey key)
 
void setShortcuts (const QList< QKeySequence > &shortcuts)
 
void setSoftKeyRole (SoftKeyRole softKeyRole)
 
void setStatusTip (const QString &statusTip)
 
void setText (const QString &text)
 
void setToggleAction (bool b)
 
void setToolTip (const QString &tip)
 
void setVisible (bool)
 
void setWhatsThis (const QString &what)
 
QKeySequence shortcut () const
 
Qt::ShortcutContext shortcutContext () const
 
QList< QKeySequenceshortcuts () const
 
bool showStatusText (QWidget *widget)
 
SoftKeyRole softKeyRole () const
 
QString statusTip () const
 
QString text () const
 
void toggle ()
 
void toggled (bool checked)
 
QString toolTip () const
 
void trigger ()
 
void triggered (bool checked)
 
QString whatsThis () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QWidgetAction
QList< QWidget * > createdWidgets () const
 
virtual QWidgetcreateWidget (QWidget *parent)
 
virtual void deleteWidget (QWidget *widget)
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *obj, QEvent *event)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QAction
 autoRepeat
 
 checkable
 
 checked
 
 enabled
 
 font
 
 icon
 
 iconText
 
 iconVisibleInMenu
 
 menuRole
 
 priority
 
 shortcut
 
 shortcutContext
 
 softKeyRole
 
 statusTip
 
 text
 
 toolTip
 
 visible
 
 whatsThis
 
- Properties inherited from QObject
 objectName
 

Detailed Description

A color swatch grid which can be embedded into a menu.

See also
QgsColorSwatchGrid
Note
introduced in QGIS 2.5

Definition at line 158 of file qgscolorswatchgrid.h.

Constructor & Destructor Documentation

◆ QgsColorSwatchGridAction()

QgsColorSwatchGridAction::QgsColorSwatchGridAction ( QgsColorScheme scheme,
QMenu menu = nullptr,
const QString context = QString(),
QWidget parent = nullptr 
)

Construct a new color swatch grid action.

Parameters
schemeQgsColorScheme for colors to show in grid
menuparent menu
contextcontext string provided to color scheme
parentparent widget

Definition at line 361 of file qgscolorswatchgrid.cpp.

◆ ~QgsColorSwatchGridAction()

QgsColorSwatchGridAction::~QgsColorSwatchGridAction ( )
virtual

Definition at line 379 of file qgscolorswatchgrid.cpp.

Member Function Documentation

◆ baseColor()

QColor QgsColorSwatchGridAction::baseColor ( ) const

Get the base color for the color grid.

Returns
base color which is passed to scheme for color generation
See also
setBaseColor

Definition at line 389 of file qgscolorswatchgrid.cpp.

◆ colorChanged

void QgsColorSwatchGridAction::colorChanged ( const QColor color)
signal

Emitted when a color has been selected from the widget.

Parameters
colorselected color

◆ context()

QString QgsColorSwatchGridAction::context ( ) const

Get the current context for the color grid.

Returns
context string which is passed to scheme for color generation
See also
setContext

Definition at line 394 of file qgscolorswatchgrid.cpp.

◆ dismissOnColorSelection()

bool QgsColorSwatchGridAction::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
Note
added in QGIS 2.14

Definition at line 213 of file qgscolorswatchgrid.h.

◆ refreshColors

void QgsColorSwatchGridAction::refreshColors ( )
slot

Reload colors from scheme and redraws the widget.

Definition at line 404 of file qgscolorswatchgrid.cpp.

◆ setBaseColor()

void QgsColorSwatchGridAction::setBaseColor ( const QColor baseColor)

Sets the base color for the color grid.

Parameters
baseColorbase color to pass to scheme for color generation
See also
baseColor

Definition at line 384 of file qgscolorswatchgrid.cpp.

◆ setContext()

void QgsColorSwatchGridAction::setContext ( const QString context)

Sets the current context for the color grid.

Parameters
contextstring which is passed to scheme for color generation
See also
context

Definition at line 399 of file qgscolorswatchgrid.cpp.

◆ setDismissOnColorSelection()

void QgsColorSwatchGridAction::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()
Note
added in QGIS 2.14

Definition at line 206 of file qgscolorswatchgrid.h.


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