Class: QgsSvgSelectorWidget

A widget allowing selection of an SVG file, and configuration of SVG related parameters.

QgsSvgSelectorWidget

QgsSvgSelectorWidget

Class Hierarchy

Inheritance diagram of qgis.gui.QgsSvgSelectorWidget

Base classes

QWidget

QObject

QPaintDevice

Methods

allowParamerters

Returns if the group box to fill parameters is visible

allowParameters

Returns if the group box to fill parameters is visible

browserVisible

Returns if the SVG browser should be visible

currentSvgPath

initParametersModel

Initialize the parameters model so the context and the layer are referenced.

populateList

propertyOverrideToolButton

Returns the property override tool button of the file line edit

setAllowParameters

Defines if the group box to fill parameters is visible

setBrowserVisible

Defines if the SVG browser should be visible

setSvgParameters

Sets the dynamic parameters

setSvgPath

Accepts absolute paths

sourceLineEdit

Returns the source line edit

Signals

svgParametersChanged

Emitted when the parameters have changed

svgSelected

Emitted when an SVG is selected in the widget.

class qgis.gui.QgsSvgSelectorWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsSvgSelectorWidget

Parameters:

parent (Optional[QWidget] = None)

allowParamerters(self) bool[source]

Returns if the group box to fill parameters is visible

Added in version 3.18.

Deprecated since version 3.40: Use allowParameters().

Return type:

bool

allowParameters(self) bool[source]

Returns if the group box to fill parameters is visible

Added in version 3.38.

Return type:

bool

browserVisible(self) bool[source]

Returns if the SVG browser should be visible

Added in version 3.20.

Return type:

bool

currentSvgPath(self) str[source]
Return type:

str

initParametersModel(self, generator: QgsExpressionContextGenerator | None, layer: QgsVectorLayer | None = None)[source]

Initialize the parameters model so the context and the layer are referenced.

Added in version 3.18.

Parameters:
populateList(self)[source]
propertyOverrideToolButton(self) QgsPropertyOverrideButton | None[source]

Returns the property override tool button of the file line edit

Added in version 3.20.

Return type:

Optional[QgsPropertyOverrideButton]

setAllowParameters(self, allow: bool)[source]

Defines if the group box to fill parameters is visible

Added in version 3.18.

Parameters:

allow (bool)

setBrowserVisible(self, visible: bool)[source]

Defines if the SVG browser should be visible

Added in version 3.20.

Parameters:

visible (bool)

setSvgParameters(self, parameters: Dict[str | None, QgsProperty])[source]

Sets the dynamic parameters

Added in version 3.18.

Parameters:

parameters (Dict[Optional[str], QgsProperty])

setSvgPath(self, svgPath: str | None)[source]

Accepts absolute paths

Parameters:

svgPath (Optional[str])

sourceLineEdit(self) QgsPictureSourceLineEditBase | None[source]

Returns the source line edit

Added in version 3.16.

Return type:

Optional[QgsPictureSourceLineEditBase]

signal svgParametersChanged(parameters: Dict[str, QgsProperty])[source]

Emitted when the parameters have changed

Added in version 3.18.

Parameters:

parameters (Dict[str, QgsProperty])

signal svgSelected(path: str)[source]

Emitted when an SVG is selected in the widget.

Parameters:

path (str)