Class: QgsStyleManagerDialog

class qgis.gui.QgsStyleManagerDialog

Bases: PyQt5.QtWidgets.QDialog

A dialog allowing users to customize and populate a QgsStyle.

QgsStyleManagerDialog(style: QgsStyle, parent: QWidget = None, flags: Union[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.

Methods

actionEvent

activate

Raises, unminimizes and activates this window

addColorRamp

Triggers adding a new color ramp.

addColorRampStatic

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

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.

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

currentItemName

rtype:

str

currentItemType

rtype:

int

customEvent

destroy

detagSelectedSymbols

Remove all tags from selected symbols

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

editColorRamp

rtype:

bool

editItem

Triggers the dialog for editing the current item.

editSmartgroupAction

Triggers the dialog for editing the selected smart group.

editSymbol

rtype:

bool

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

enterEvent

event

eventFilter

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.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

groupChanged

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

groupRenamed

Triggered when a group item is renamed.

grouptreeContextMenu

Context menu for the groupTree

hideEvent

importItems

Triggers the dialog to import items.

initPainter

inputMethodEvent

isSignalConnected

itemChanged

Deprecated since version QGIS: 3.6

keyPressEvent

keyReleaseEvent

leaveEvent

listitemsContextMenu

Context menu for the listItems ( symbols list )

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

onClose

Closes the dialog

onFinished

Called when the dialog is going to be closed.

paintEvent

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).

receivers

regrouped

Deprecated since version QGIS: 3.6

removeColorRamp

Deprecated since version QGIS: 3.6

removeFavoriteSelectedSymbols

Remove selected symbols from favorites

removeGroup

Removes the selected tag or smartgroup.

removeItem

Removes the current selected item.

removeSymbol

Deprecated since version QGIS: 3.6

resizeEvent

selectedSymbolsChanged

Perform tasks when the selected symbols change

sender

senderSignalIndex

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

Deprecated since version QGIS: 3.6

sharedPainter

showEvent

showHelp

Opens the associated help

symbolSelected

Perform symbol specific tasks when selected

tabletEvent

tagSelectedSymbols

Tag selected symbols using menu item selection

tagSymbolsAction

Toggles the interactive item tagging mode.

timerEvent

updateMicroFocus

wheelEvent

actionEvent(self, QActionEvent)
activate(self)

Raises, unminimizes and activates this window

New in version 3.4.

addColorRamp(self, type: str = '') bool

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 (str = '') –

Return type:

bool

addColorRampStatic(parent: QWidget, style: QgsStyle, RampType: str = '') str

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 (QWidget) –

  • style (QgsStyle) –

  • RampType (str = '') –

Return type:

str

addFavoriteSelectedSymbols(self)

Add selected symbols to favorites

addItem(self)

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

addSmartgroup(self) int

Triggers the dialog to add a new smart group.

Return type:

int

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

add a new symbol to style

Parameters:

symbolType (int = -1) –

Return type:

bool

addTag(self) int

Triggers the dialog to add a new tag.

Return type:

int

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
currentItemName(self) str
Return type:

str

currentItemType(self) int
Return type:

int

customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
detagSelectedSymbols(self)

Remove all tags from selected symbols

disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
editColorRamp(self) bool
Return type:

bool

editItem(self)

Triggers the dialog for editing the current item.

editSmartgroupAction(self)

Triggers the dialog for editing the selected smart group.

editSymbol(self) bool
Return type:

bool

enableGroupInputs(self, bool)

Enables or disables the groupTree specific inputs

enableItemsForGroupingMode(self, bool)

Enables or disables the groupTree items for grouping mode

enableSymbolInputs(self, bool)

Enables or disbables the symbol specific inputs

enterEvent(self, QEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
exportItems(self)

Triggers the dialog to export items.

See also

importItems()

exportItemsPNG(self)

Triggers the dialog to export selected items as PNG files.

See also

exportItemsSVG()

exportItemsSVG(self)

Triggers the dialog to export selected items as SVG files.

See also

exportItemsPNG()

exportSelectedItemsImages(self, dir: str, format: str, size: QSize)

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

See also

exportItemsSVG()

See also

exportItemsPNG()

Parameters:
  • dir (str) –

  • format (str) –

  • size (QSize) –

filterSymbols(self, filter: str)

Sets the filter string to filter symbols by.

Parameters:

filter (str) –

focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
groupChanged(self, QModelIndex)

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

groupRenamed(self, item: QStandardItem)

Triggered when a group item is renamed.

Parameters:

item (QStandardItem) –

grouptreeContextMenu(self, QPoint)

Context menu for the groupTree

hideEvent(self, QHideEvent)
importItems(self)

Triggers the dialog to import items.

See also

exportItems()

initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
itemChanged(self, item: QStandardItem)

Deprecated since version QGIS: 3.6 - has no effect and will be removed in QGIS 4.0

Parameters:

item (QStandardItem) –

keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
listitemsContextMenu(self, QPoint)

Context menu for the listItems ( symbols list )

metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
onClose(self)

Closes the dialog

onFinished(self)

Called when the dialog is going to be closed.

paintEvent(self, QPaintEvent)
populateColorRamps(self, colorRamps: Iterable[str], checkable: bool = False)

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

Deprecated since version 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[str]) –

  • checkable (bool = False) –

populateGroups(self)

populate the groups

populateList(self)

Refreshes the list of items.

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

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

Deprecated since version 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[str]) –

  • checkable (bool = False) –

populateTypes(self)

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

Deprecated since version QGIS: 3.6 - has no effect and will be removed in QGIS 4.0

receivers(self, PYQT_SIGNAL) int
regrouped(self, QStandardItem)

Deprecated since version QGIS: 3.6 - has no effect and will be removed in QGIS 4.0

removeColorRamp(self) bool

Deprecated since version QGIS: 3.6 - has no effect and will be removed in QGIS 4.0

Return type:

bool

removeFavoriteSelectedSymbols(self)

Remove selected symbols from favorites

removeGroup(self)

Removes the selected tag or smartgroup.

removeItem(self)

Removes the current selected item.

removeSymbol(self) bool

Deprecated since version QGIS: 3.6 - has no effect and will be removed in QGIS 4.0

Return type:

bool

resizeEvent(self, QResizeEvent)
selectedSymbolsChanged(self, selected: QItemSelection, deselected: QItemSelection)

Perform tasks when the selected symbols change

Parameters:
  • selected (QItemSelection) –

  • deselected (QItemSelection) –

sender(self) QObject
senderSignalIndex(self) int
setBaseStyleName(self, name: str)

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”.

New in version 3.6.

Parameters:

name (str) –

setBold(self, QStandardItem)

sets the text of the item with bold font

setFavoritesGroupVisible(self, show: bool)

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

New in version 3.6.

Parameters:

show (bool) –

setSmartGroupsVisible(self, show: bool)

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

New in version 3.6.

Parameters:

show (bool) –

setSymbolsChecked(self, Iterable[str])

Deprecated since version QGIS: 3.6 - has no effect and will be removed in QGIS 4.0

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
showHelp(self)

Opens the associated help

symbolSelected(self, QModelIndex)

Perform symbol specific tasks when selected

tabletEvent(self, QTabletEvent)
tagSelectedSymbols(self, newTag: bool = False)

Tag selected symbols using menu item selection

Parameters:

newTag (bool = False) –

tagSymbolsAction(self)

Toggles the interactive item tagging mode.

timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)