QGIS API Documentation  3.6.0-Noosa (5873452)
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QgsSymbolSelectorWidget Class Reference

Symbol selector widget that can be used to select and build a symbol. More...

#include <qgssymbolselectordialog.h>

Inheritance diagram for QgsSymbolSelectorWidget:
Inheritance graph
[legend]

Public Slots

void addLayer ()
 Add a symbol layer to the bottom of the stack. More...
 
void changeLayer (QgsSymbolLayer *layer)
 alters tree and sets proper widget when Layer Type is changed More...
 
void duplicateLayer ()
 Duplicates the current symbol layer and places the duplicated layer above the current symbol layer. More...
 
void layerChanged ()
 Called when the layer changes in the widget. More...
 
void lockLayer ()
 Lock the current active symbol layer. More...
 
void moveLayerDown ()
 Move the active symbol layer down. More...
 
void moveLayerUp ()
 Move the active symbol layer up. More...
 
void removeLayer ()
 Remove the current active symbol layer. More...
 
void symbolChanged ()
 Slot to update tree when a new symbol from style. More...
 
void updateLayerPreview ()
 Update the single symbol layer preview in the widget. More...
 
void updatePreview ()
 Update the preview of the whole symbol in the interface. 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 symbolModified ()
 Emiited when a symbol is modified in the widget. 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

 QgsSymbolSelectorWidget (QgsSymbol *symbol, QgsStyle *style, QgsVectorLayer *vl, QWidget *parent=nullptr)
 Symbol selector widget that can be used to select and build a symbol. More...
 
QMenu * advancedMenu ()
 Returns menu for "advanced" button - create it if doesn't exist and show the advanced button. More...
 
QgsSymbolWidgetContext context () const
 Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts. More...
 
void setContext (const QgsSymbolWidgetContext &context)
 Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts. More...
 
QgsSymbolsymbol ()
 Returns the symbol that is currently active in the widget. 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 ()
 Returns 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

QgsSymbolLayercurrentLayer ()
 The current symbol layer that is active in the interface. More...
 
SymbolLayerItem * currentLayerItem ()
 
void loadSymbol ()
 Reload the current symbol in the view. More...
 
void loadSymbol (QgsSymbol *symbol, SymbolLayerItem *parent)
 Load the given symbol into the widget. More...
 
void moveLayerByOffset (int offset)
 Move the current active layer by a set offset in the list. More...
 
void setWidget (QWidget *widget)
 Set the properties widget for the active symbol layer. More...
 
void updateLockButton ()
 Update the lock button states based on the current symbol layer. More...
 
void updateUi ()
 Update the state of the UI based on the currently set symbol layer. More...
 
- Protected Member Functions inherited from QgsPanelWidget
void keyPressEvent (QKeyEvent *event) override
 Overridden key press event to handle the esc event on the widget. More...
 

Protected Attributes

QMenu * mAdvancedMenu = nullptr
 
QStandardItemModel * model = nullptr
 
QWidget * mPresentWidget = nullptr
 
QgsStylemStyle = nullptr
 
QgsSymbolmSymbol = nullptr
 
QgsVectorLayermVectorLayer = nullptr
 

Friends

class QgsSymbolSelectorDialog
 To allow for non API break access from the dialog. 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

Symbol selector widget that can be used to select and build a symbol.

Definition at line 87 of file qgssymbolselectordialog.h.

Constructor & Destructor Documentation

◆ QgsSymbolSelectorWidget()

QgsSymbolSelectorWidget::QgsSymbolSelectorWidget ( QgsSymbol symbol,
QgsStyle style,
QgsVectorLayer vl,
QWidget *  parent = nullptr 
)

Symbol selector widget that can be used to select and build a symbol.

Parameters
symbolThe symbol to load into the widget as a start point.
styleThe style used by the widget.
vlThe vector layer for the symbol.
parent

Definition at line 231 of file qgssymbolselectordialog.cpp.

Member Function Documentation

◆ addLayer

void QgsSymbolSelectorWidget::addLayer ( )
slot

Add a symbol layer to the bottom of the stack.

Definition at line 573 of file qgssymbolselectordialog.cpp.

◆ advancedMenu()

QMenu * QgsSymbolSelectorWidget::advancedMenu ( )

Returns menu for "advanced" button - create it if doesn't exist and show the advanced button.

Definition at line 342 of file qgssymbolselectordialog.cpp.

◆ changeLayer

void QgsSymbolSelectorWidget::changeLayer ( QgsSymbolLayer layer)
slot

alters tree and sets proper widget when Layer Type is changed

Note
: The layer is received from the LayerPropertiesWidget

Definition at line 727 of file qgssymbolselectordialog.cpp.

◆ context()

QgsSymbolWidgetContext QgsSymbolSelectorWidget::context ( ) const

Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

See also
setContext()
Since
QGIS 3.0

Definition at line 379 of file qgssymbolselectordialog.cpp.

◆ currentLayer()

QgsSymbolLayer * QgsSymbolSelectorWidget::currentLayer ( )
protected

The current symbol layer that is active in the interface.

Returns
The active symbol layer.

Definition at line 474 of file qgssymbolselectordialog.cpp.

◆ currentLayerItem()

SymbolLayerItem * QgsSymbolSelectorWidget::currentLayerItem ( )
protected
Note
not available in Python bindings

Definition at line 461 of file qgssymbolselectordialog.cpp.

◆ duplicateLayer

void QgsSymbolSelectorWidget::duplicateLayer ( )
slot

Duplicates the current symbol layer and places the duplicated layer above the current symbol layer.

Since
QGIS 2.14

Definition at line 690 of file qgssymbolselectordialog.cpp.

◆ layerChanged

void QgsSymbolSelectorWidget::layerChanged ( )
slot

Called when the layer changes in the widget.

Updates the active properties for active symbol layer.

Definition at line 487 of file qgssymbolselectordialog.cpp.

◆ loadSymbol() [1/2]

void QgsSymbolSelectorWidget::loadSymbol ( )
protected

Reload the current symbol in the view.

Definition at line 408 of file qgssymbolselectordialog.cpp.

◆ loadSymbol() [2/2]

void QgsSymbolSelectorWidget::loadSymbol ( QgsSymbol symbol,
SymbolLayerItem *  parent 
)
protected

Load the given symbol into the widget.

Parameters
symbolThe symbol to load.
parentThe parent symbol layer item.
Note
not available in Python bindings

Definition at line 384 of file qgssymbolselectordialog.cpp.

◆ lockLayer

void QgsSymbolSelectorWidget::lockLayer ( )
slot

Lock the current active symbol layer.

Definition at line 681 of file qgssymbolselectordialog.cpp.

◆ moveLayerByOffset()

void QgsSymbolSelectorWidget::moveLayerByOffset ( int  offset)
protected

Move the current active layer by a set offset in the list.

Parameters
offsetThe offset to move the layer by

Definition at line 655 of file qgssymbolselectordialog.cpp.

◆ moveLayerDown

void QgsSymbolSelectorWidget::moveLayerDown ( )
slot

Move the active symbol layer down.

Definition at line 645 of file qgssymbolselectordialog.cpp.

◆ moveLayerUp

void QgsSymbolSelectorWidget::moveLayerUp ( )
slot

Move the active symbol layer up.

Definition at line 650 of file qgssymbolselectordialog.cpp.

◆ removeLayer

void QgsSymbolSelectorWidget::removeLayer ( )
slot

Remove the current active symbol layer.

Definition at line 623 of file qgssymbolselectordialog.cpp.

◆ setContext()

void QgsSymbolSelectorWidget::setContext ( const QgsSymbolWidgetContext context)

Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

Parameters
contextsymbol widget context
See also
context()
Since
QGIS 3.0

Definition at line 353 of file qgssymbolselectordialog.cpp.

◆ setWidget()

void QgsSymbolSelectorWidget::setWidget ( QWidget *  widget)
protected

Set the properties widget for the active symbol layer.

Parameters
widgetThe widget to set to configure the active symbol layer.

Definition at line 556 of file qgssymbolselectordialog.cpp.

◆ symbol()

QgsSymbol* QgsSymbolSelectorWidget::symbol ( )
inline

Returns the symbol that is currently active in the widget.

Can be null.

Returns
The active symbol.

Definition at line 128 of file qgssymbolselectordialog.h.

◆ symbolChanged

void QgsSymbolSelectorWidget::symbolChanged ( )
slot

Slot to update tree when a new symbol from style.

Definition at line 527 of file qgssymbolselectordialog.cpp.

◆ symbolModified

void QgsSymbolSelectorWidget::symbolModified ( )
signal

Emiited when a symbol is modified in the widget.

◆ updateLayerPreview

void QgsSymbolSelectorWidget::updateLayerPreview ( )
slot

Update the single symbol layer preview in the widget.

Definition at line 451 of file qgssymbolselectordialog.cpp.

◆ updateLockButton()

void QgsSymbolSelectorWidget::updateLockButton ( )
protected

Update the lock button states based on the current symbol layer.

Definition at line 565 of file qgssymbolselectordialog.cpp.

◆ updatePreview

void QgsSymbolSelectorWidget::updatePreview ( )
slot

Update the preview of the whole symbol in the interface.

Definition at line 441 of file qgssymbolselectordialog.cpp.

◆ updateUi()

void QgsSymbolSelectorWidget::updateUi ( )
protected

Update the state of the UI based on the currently set symbol layer.

Definition at line 414 of file qgssymbolselectordialog.cpp.

Friends And Related Function Documentation

◆ QgsSymbolSelectorDialog

friend class QgsSymbolSelectorDialog
friend

To allow for non API break access from the dialog.

Definition at line 91 of file qgssymbolselectordialog.h.

Member Data Documentation

◆ mAdvancedMenu

QMenu* QgsSymbolSelectorWidget::mAdvancedMenu = nullptr
protected

Definition at line 245 of file qgssymbolselectordialog.h.

◆ model

QStandardItemModel* QgsSymbolSelectorWidget::model = nullptr
protected

Definition at line 248 of file qgssymbolselectordialog.h.

◆ mPresentWidget

QWidget* QgsSymbolSelectorWidget::mPresentWidget = nullptr
protected

Definition at line 249 of file qgssymbolselectordialog.h.

◆ mStyle

QgsStyle* QgsSymbolSelectorWidget::mStyle = nullptr
protected

Definition at line 243 of file qgssymbolselectordialog.h.

◆ mSymbol

QgsSymbol* QgsSymbolSelectorWidget::mSymbol = nullptr
protected

Definition at line 244 of file qgssymbolselectordialog.h.

◆ mVectorLayer

QgsVectorLayer* QgsSymbolSelectorWidget::mVectorLayer = nullptr
protected

Definition at line 246 of file qgssymbolselectordialog.h.


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