Class: QgsStyleManagerDialog

A dialog allowing users to customize and populate a QgsStyle.

QgsStyleManagerDialog

QgsStyleManagerDialog

Class Hierarchy

Inheritance diagram of qgis.gui.QgsStyleManagerDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

Methods

activate

Raises, unminimizes and activates this window

addColorRamp

Triggers adding a new color ramp.

addFavoriteSelectedSymbols

Add selected symbols to favorites

addItem

Triggers the dialog for adding a new item, based on the currently selected item type tab.

addSmartgroup

Triggers the dialog to add a new smart group.

addSymbol

add a new symbol to style

addTag

Triggers the dialog to add a new tag.

currentItemName

currentItemType

detagSelectedSymbols

Remove all tags from selected symbols

editColorRamp

editItem

Triggers the dialog for editing the current item.

editSmartgroupAction

Triggers the dialog for editing the selected smart group.

editSymbol

enableGroupInputs

Enables or disables the groupTree specific inputs

enableItemsForGroupingMode

Enables or disables the groupTree items for grouping mode

enableSymbolInputs

Enables or disbables the symbol specific inputs

exportItems

Triggers the dialog to export items.

exportItemsPNG

Triggers the dialog to export selected items as PNG files.

exportItemsSVG

Triggers the dialog to export selected items as SVG files.

exportSelectedItemsImages

Triggers the dialog to export selected items as images of the specified format and size.

filterSymbols

Sets the filter string to filter symbols by.

groupChanged

Triggered when the current group (or tag) is changed.

groupRenamed

Triggered when a group item is renamed.

grouptreeContextMenu

Context menu for the groupTree

importItems

Triggers the dialog to import items.

itemChanged

listitemsContextMenu

Context menu for the listItems ( symbols list )

onClose

Closes the dialog

onFinished

Called when the dialog is going to be closed.

populateColorRamps

Populates the list view with color ramps of the current type with the given names.

populateGroups

populate the groups

populateList

Refreshes the list of items.

populateSymbols

Populates the list view with symbols of the current type with the given names.

populateTypes

Populate combo box with known style items (symbols, color ramps).

regrouped

removeColorRamp

removeFavoriteSelectedSymbols

Remove selected symbols from favorites

removeGroup

Removes the selected tag or smartgroup.

removeItem

Removes the current selected item.

removeSymbol

selectedSymbolsChanged

Perform tasks when the selected symbols change

setBaseStyleName

Sets the base name for the style, which is used by the dialog to reflect the original style/XML file name.

setBold

sets the text of the item with bold font

setFavoritesGroupVisible

Sets whether the favorites group should be shown.

setSmartGroupsVisible

Sets whether smart groups should be shown.

setSymbolsChecked

showHelp

Opens the associated help

symbolSelected

Perform symbol specific tasks when selected

tagSelectedSymbols

Tag selected symbols using menu item selection

tagSymbolsAction

Toggles the interactive item tagging mode.

Static Methods

addColorRampStatic

Opens the add color ramp dialog, returning the new color ramp's name if the ramp has been added.

class qgis.gui.QgsStyleManagerDialog[source]

Bases: QDialog

__init__(style: QgsStyle | None, parent: QWidget | None = None, flags: Qt.WindowFlags | Qt.WindowType = Qt.WindowFlags(), readOnly: bool = False)

Constructor for QgsStyleManagerDialog, with the specified parent widget and window flags.

The style argument specifies the linked QgsStyle database. Symbols and objects contained within this style will be shown in the dialog, and changes made within the dialog will be applied to style. The style object must last for the lifetime of the dialog.

Parameters:
  • style (Optional[QgsStyle])

  • parent (Optional[QWidget] = None)

  • flags (Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags())

  • readOnly (bool = False)

__init__(parent: QWidget | None = None, flags: Qt.WindowFlags | Qt.WindowType = Qt.WindowFlags())

Constructor for QgsStyleManagerDialog, with the specified parent widget and window flags.

All styles linked to the current project will be available.

Added in version 3.26.

Parameters:
  • parent (Optional[QWidget] = None)

  • flags (Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags())

activate(self)[source]

Raises, unminimizes and activates this window

Added in version 3.4.

addColorRamp(self, type: str | None = '') bool[source]

Triggers adding a new color ramp.

If type is set to a string representing a valid QgsColorRamp.type() value then a new ramp of that type will be created. If type is empty, then the user will be prompted to select the color ramp type.

Parameters:

type (Optional[str] = '')

Return type:

bool

static addColorRampStatic(parent: QWidget | None, style: QgsStyle | None, RampType: str | None = '') str[source]

Opens the add color ramp dialog, returning the new color ramp’s name if the ramp has been added.

The RampType argument should be set to a string representing a valid QgsColorRamp.type() value.

Parameters:
  • parent (Optional[QWidget])

  • style (Optional[QgsStyle])

  • RampType (Optional[str] = '')

Return type:

str

addFavoriteSelectedSymbols(self)[source]

Add selected symbols to favorites

addItem(self)[source]

Triggers the dialog for adding a new item, based on the currently selected item type tab.

addSmartgroup(self) int[source]

Triggers the dialog to add a new smart group.

Return type:

int

addSymbol(self, symbolType: int = -1) bool[source]

add a new symbol to style

Parameters:

symbolType (int = -1)

Return type:

bool

addTag(self) int[source]

Triggers the dialog to add a new tag.

Return type:

int

currentItemName(self) str[source]
Return type:

str

currentItemType(self) int[source]
Return type:

int

detagSelectedSymbols(self)[source]

Remove all tags from selected symbols

editColorRamp(self) bool[source]
Return type:

bool

editItem(self)[source]

Triggers the dialog for editing the current item.

editSmartgroupAction(self)[source]

Triggers the dialog for editing the selected smart group.

editSymbol(self) bool[source]
Return type:

bool

enableGroupInputs(self, a0: bool)[source]

Enables or disables the groupTree specific inputs

Parameters:

a0 (bool)

enableItemsForGroupingMode(self, a0: bool)[source]

Enables or disables the groupTree items for grouping mode

Parameters:

a0 (bool)

enableSymbolInputs(self, a0: bool)[source]

Enables or disbables the symbol specific inputs

Parameters:

a0 (bool)

exportItems(self)[source]

Triggers the dialog to export items.

See also

importItems()

exportItemsPNG(self)[source]

Triggers the dialog to export selected items as PNG files.

See also

exportItemsSVG()

exportItemsSVG(self)[source]

Triggers the dialog to export selected items as SVG files.

See also

exportItemsPNG()

exportSelectedItemsImages(self, dir: str | None, format: str | None, size: QSize)[source]

Triggers the dialog to export selected items as images of the specified format and size.

See also

exportItemsSVG()

See also

exportItemsPNG()

Parameters:
  • dir (Optional[str])

  • format (Optional[str])

  • size (QSize)

filterSymbols(self, filter: str | None)[source]

Sets the filter string to filter symbols by.

Parameters:

filter (Optional[str])

groupChanged(self, a0: QModelIndex)[source]

Triggered when the current group (or tag) is changed.

Parameters:

a0 (QModelIndex)

groupRenamed(self, item: QStandardItem | None)[source]

Triggered when a group item is renamed.

Parameters:

item (Optional[QStandardItem])

grouptreeContextMenu(self, a0: QPoint)[source]

Context menu for the groupTree

Parameters:

a0 (QPoint)

importItems(self)[source]

Triggers the dialog to import items.

See also

exportItems()

itemChanged(self, item: QStandardItem | None)[source]

Deprecated since version 3.6.

Has no effect and will be removed in QGIS 4.0.

Parameters:

item (Optional[QStandardItem])

listitemsContextMenu(self, a0: QPoint)[source]

Context menu for the listItems ( symbols list )

Parameters:

a0 (QPoint)

onClose(self)[source]

Closes the dialog

onFinished(self)[source]

Called when the dialog is going to be closed.

populateColorRamps(self, colorRamps: Iterable[str | None], checkable: bool = False)[source]

Populates the list view with color ramps of the current type with the given names.

Deprecated since version 3.40: No longer required in QGIS 3.6, as the model is updated live. Has no effect and will be removed in QGIS 4.0.

Parameters:
  • colorRamps (Iterable[Optional[str]])

  • checkable (bool = False)

populateGroups(self)[source]

populate the groups

populateList(self)[source]

Refreshes the list of items.

populateSymbols(self, symbolNames: Iterable[str | None], checkable: bool = False)[source]

Populates the list view with symbols of the current type with the given names.

Deprecated since version 3.40: No longer required in QGIS 3.6, as the model is updated live. Has no effect and will be removed in QGIS 4.0.

Parameters:
  • symbolNames (Iterable[Optional[str]])

  • checkable (bool = False)

populateTypes(self)[source]

Populate combo box with known style items (symbols, color ramps).

Deprecated since version 3.6: Has no effect and will be removed in QGIS 4.0.

regrouped(self, a0: QStandardItem | None)[source]

Deprecated since version 3.6.

Has no effect and will be removed in QGIS 4.0.

Parameters:

a0 (Optional[QStandardItem])

removeColorRamp(self) bool[source]

Deprecated since version 3.6.

Has no effect and will be removed in QGIS 4.0.

Return type:

bool

removeFavoriteSelectedSymbols(self)[source]

Remove selected symbols from favorites

removeGroup(self)[source]

Removes the selected tag or smartgroup.

removeItem(self)[source]

Removes the current selected item.

removeSymbol(self) bool[source]

Deprecated since version 3.6.

Has no effect and will be removed in QGIS 4.0.

Return type:

bool

selectedSymbolsChanged(self, selected: QItemSelection, deselected: QItemSelection)[source]

Perform tasks when the selected symbols change

Parameters:
  • selected (QItemSelection)

  • deselected (QItemSelection)

setBaseStyleName(self, name: str | None)[source]

Sets the base name for the style, which is used by the dialog to reflect the original style/XML file name.

name should be stripped of any extensions and folder information, e.g. “transport_styles”, not “d:/stuff/transport_styles.xml”.

Added in version 3.6.

Parameters:

name (Optional[str])

setBold(self, a0: QStandardItem | None)[source]

sets the text of the item with bold font

Parameters:

a0 (Optional[QStandardItem])

setFavoritesGroupVisible(self, show: bool)[source]

Sets whether the favorites group should be shown. The default is to show the group.

Added in version 3.6.

Parameters:

show (bool)

setSmartGroupsVisible(self, show: bool)[source]

Sets whether smart groups should be shown. The default is to show the groups.

Added in version 3.6.

Parameters:

show (bool)

setSymbolsChecked(self, a0: Iterable[str | None])[source]

Deprecated since version 3.6.

Has no effect and will be removed in QGIS 4.0.

Parameters:

a0 (Iterable[Optional[str]])

showHelp(self)[source]

Opens the associated help

symbolSelected(self, a0: QModelIndex)[source]

Perform symbol specific tasks when selected

Parameters:

a0 (QModelIndex)

tagSelectedSymbols(self, newTag: bool = False)[source]

Tag selected symbols using menu item selection

Parameters:

newTag (bool = False)

tagSymbolsAction(self)[source]

Toggles the interactive item tagging mode.