Class: QgsLegendPatchShapeButton¶
A button for creating and modifying QgsLegendPatchShape
settings.
Added in version 3.14.
Class Hierarchy¶
Base classes¶
Methods
Returns the title for the symbol settings dialog window. |
|
Returns the message bar associated with the widget. |
|
Sets the title for the symbol settings dialog window. |
|
Sets the message bar associated with the widget. |
|
Sets the symbol to use for previewing the legend patch shape. |
|
Sets the shape for the button. |
|
Sets the symbol type which the button requires. |
|
Resets the shape to the default shape. |
|
Returns the current shape defined by the button. |
|
Returns the symbol type which the button requires. |
Signals
Emitted when the shape's settings are changed. |
- class qgis.gui.QgsLegendPatchShapeButton[source]¶
Bases:
QToolButton
- __init__(parent: QWidget | None = None, dialogTitle: str | None = '')
Construct a new patch shape button with the specified
parent
widget. UsedialogTitle
string to define the title to show in the legend patch shape widget.- Parameters:
parent (Optional[QWidget] = None)
dialogTitle (Optional[str] = '')
- dialogTitle(self) str [source]¶
Returns the title for the symbol settings dialog window.
See also
- Return type:
str
- messageBar(self) QgsMessageBar | None [source]¶
Returns the message bar associated with the widget.
See also
Added in version 3.6.
- Return type:
Optional[QgsMessageBar]
- setDialogTitle(self, title: str | None)[source]¶
Sets the
title
for the symbol settings dialog window.See also
- Parameters:
title (Optional[str])
- setMessageBar(self, bar: QgsMessageBar | None)[source]¶
Sets the message
bar
associated with the widget. This allows the widget to push feedback messages to the appropriate message bar.See also
Added in version 3.6.
- Parameters:
bar (Optional[QgsMessageBar])
- setPreviewSymbol(self, symbol: QgsSymbol | None)[source]¶
Sets the symbol to use for previewing the legend patch shape.
Ownership is transferred to the button. It is the caller’s responsibility to ensure that the symbol type matches the button’s
symbolType()
- Parameters:
symbol (Optional[QgsSymbol])
- setShape(self, shape: QgsLegendPatchShape)[source]¶
Sets the
shape
for the button.See also
See also
- Parameters:
shape (QgsLegendPatchShape)
- setSymbolType(self, type: Qgis.SymbolType)[source]¶
Sets the symbol
type
which the button requires. If the type differs from the current symbol type, the symbol will be reset to a default symbol style of the new type.See also
- Parameters:
type (Qgis.SymbolType)
- shape(self) QgsLegendPatchShape [source]¶
Returns the current shape defined by the button.
See also
See also
- Return type:
- symbolType(self) Qgis.SymbolType [source]¶
Returns the symbol type which the button requires.
See also
- Return type: