QGIS API Documentation 3.41.0-Master (25ec5511245)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Static Public Member Functions | 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.
 
void changeLayer (QgsSymbolLayer *layer)
 Alters tree and sets proper widget when Layer Type is changed.
 
void duplicateLayer ()
 Duplicates the current symbol layer and places the duplicated layer above the current symbol layer.
 
void layerChanged ()
 Called when the layer changes in the widget.
 
void lockLayer ()
 Lock the current active symbol layer.
 
void moveLayerDown ()
 Move the active symbol layer down.
 
void moveLayerUp ()
 Move the active symbol layer up.
 
void removeLayer ()
 Remove the current active symbol layer.
 
void symbolChanged ()
 Slot to update tree when a new symbol from style.
 
void updateLayerPreview ()
 Update the single symbol layer preview in the widget.
 
void updatePreview ()
 Update the preview of the whole symbol in the interface.
 
- Public Slots inherited from QgsPanelWidget
void acceptPanel ()
 Accept the panel.
 
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.
 

Signals

void symbolModified ()
 Emitted when a symbol is modified in the widget.
 
- Signals inherited from QgsPanelWidget
void panelAccepted (QgsPanelWidget *panel)
 Emitted when the panel is accepted by the user.
 
void showPanel (QgsPanelWidget *panel)
 Emit when you require a panel to be show in the interface.
 
void widgetChanged ()
 Emitted when the widget state changes.
 

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.
 
QMenu * advancedMenu ()
 Returns menu for "advanced" button - create it if doesn't exist and show the advanced button.
 
QgsSymbolWidgetContext context () const
 Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.
 
void loadSymbol (QgsSymbol *symbol, SymbolLayerItem *parent=nullptr)
 Loads the given symbol into the widget.
 
void setContext (const QgsSymbolWidgetContext &context)
 Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.
 
QgsSymbolsymbol ()
 Returns the symbol that is currently active in the widget.
 
- Public Member Functions inherited from QgsPanelWidget
 QgsPanelWidget (QWidget *parent=nullptr)
 Base class for any widget that can be shown as a inline panel.
 
virtual bool applySizeConstraintsToStack () const
 Returns true if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.
 
bool autoDelete ()
 The the auto delete property on the widget.
 
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.
 
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.
 
bool dockMode ()
 Returns the dock mode state.
 
virtual QMenu * menuButtonMenu ()
 Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required.
 
virtual QString menuButtonTooltip () const
 Returns the (translated) tooltip text to use for the menu button for this panel.
 
QString panelTitle ()
 The title of the panel.
 
void setAutoDelete (bool autoDelete)
 The the auto delete property on the widget.
 
virtual void setDockMode (bool dockMode)
 Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
 
void setPanelTitle (const QString &panelTitle)
 Set the title of the panel when shown in the interface.
 

Static Public Member Functions

static QgsSymbolSelectorWidgetcreateWidgetWithSymbolOwnership (std::unique_ptr< QgsSymbol > symbol, QgsStyle *style, QgsVectorLayer *vl, QWidget *parent=nullptr)
 Creates a QgsSymbolSelectorWidget which takes ownership of a symbol and maintains the ownership for the life of the widget.
 
- 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.
 

Friends

class QgsSymbolSelectorDialog
 To allow for non API break access from the dialog.
 

Additional Inherited Members

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

Detailed Description

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

Definition at line 88 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
Note
The ownership of the symbol is not transferred and must exist for the lifetime of the widget.

Definition at line 252 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 659 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 398 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 815 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()

Definition at line 432 of file qgssymbolselectordialog.cpp.

◆ createWidgetWithSymbolOwnership()

QgsSymbolSelectorWidget * QgsSymbolSelectorWidget::createWidgetWithSymbolOwnership ( std::unique_ptr< QgsSymbol symbol,
QgsStyle style,
QgsVectorLayer vl,
QWidget *  parent = nullptr 
)
static

Creates a QgsSymbolSelectorWidget which takes ownership of a symbol and maintains the ownership for the life of the widget.

Note
Not available in Python bindings.

Definition at line 390 of file qgssymbolselectordialog.cpp.

◆ duplicateLayer

void QgsSymbolSelectorWidget::duplicateLayer ( )
slot

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

Definition at line 777 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 558 of file qgssymbolselectordialog.cpp.

◆ loadSymbol()

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

Loads the given symbol into the widget.

Parameters
symbolThe symbol to load.
parentThe parent symbol layer item. If the parent parameter is null, the whole symbol and model will be reset.
Note
The ownership of the symbol is not transferred and must exist for the lifetime of the widget.

Definition at line 437 of file qgssymbolselectordialog.cpp.

◆ lockLayer

void QgsSymbolSelectorWidget::lockLayer ( )
slot

Lock the current active symbol layer.

Definition at line 767 of file qgssymbolselectordialog.cpp.

◆ moveLayerDown

void QgsSymbolSelectorWidget::moveLayerDown ( )
slot

Move the active symbol layer down.

Definition at line 731 of file qgssymbolselectordialog.cpp.

◆ moveLayerUp

void QgsSymbolSelectorWidget::moveLayerUp ( )
slot

Move the active symbol layer up.

Definition at line 736 of file qgssymbolselectordialog.cpp.

◆ removeLayer

void QgsSymbolSelectorWidget::removeLayer ( )
slot

Remove the current active symbol layer.

Definition at line 709 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()

Definition at line 409 of file qgssymbolselectordialog.cpp.

◆ symbol()

QgsSymbol * QgsSymbolSelectorWidget::symbol ( )
inline

Returns the symbol that is currently active in the widget.

Can be nullptr.

Returns
The active symbol.

Definition at line 138 of file qgssymbolselectordialog.h.

◆ symbolChanged

void QgsSymbolSelectorWidget::symbolChanged ( )
slot

Slot to update tree when a new symbol from style.

Definition at line 598 of file qgssymbolselectordialog.cpp.

◆ symbolModified

void QgsSymbolSelectorWidget::symbolModified ( )
signal

Emitted 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 522 of file qgssymbolselectordialog.cpp.

◆ updatePreview

void QgsSymbolSelectorWidget::updatePreview ( )
slot

Update the preview of the whole symbol in the interface.

Definition at line 509 of file qgssymbolselectordialog.cpp.

Friends And Related Symbol Documentation

◆ QgsSymbolSelectorDialog

friend class QgsSymbolSelectorDialog
friend

To allow for non API break access from the dialog.

Definition at line 92 of file qgssymbolselectordialog.h.


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