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 forQgsStyleManagerDialog
, with the specifiedparent
widget and windowflags
.The
style
argument specifies the linkedQgsStyle
database. Symbols and objects contained within this style will be shown in the dialog, and changes made within the dialog will be applied tostyle
. Thestyle
object must last for the lifetime of the dialog.QgsStyleManagerDialog(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags()) Constructor for
QgsStyleManagerDialog
, with the specifiedparent
widget and windowflags
.All styles linked to the current project will be available.
New in version 3.26:
Methods
Raises, unminimizes and activates this window
Triggers adding a new color ramp.
Opens the add color ramp dialog, returning the new color ramp's name if the ramp has been added.
Add selected symbols to favorites
Triggers the dialog for adding a new item, based on the currently selected item type tab.
Triggers the dialog to add a new smart group.
add a new symbol to style
Triggers the dialog to add a new tag.
- rtype:
str
- rtype:
int
Remove all tags from selected symbols
- rtype:
bool
Triggers the dialog for editing the current item.
Triggers the dialog for editing the selected smart group.
- rtype:
bool
Enables or disables the groupTree specific inputs
Enables or disables the groupTree items for grouping mode
Enables or disbables the symbol specific inputs
Triggers the dialog to export items.
Triggers the dialog to export selected items as PNG files.
Triggers the dialog to export selected items as SVG files.
Triggers the dialog to export selected items as images of the specified
format
andsize
.Sets the
filter
string to filter symbols by.Triggered when the current group (or tag) is changed.
Triggered when a group
item
is renamed.Context menu for the groupTree
Triggers the dialog to import items.
Deprecated since version QGIS: 3.6
Context menu for the listItems ( symbols list )
Closes the dialog
Called when the dialog is going to be closed.
Populates the list view with color ramps of the current type with the given names.
populate the groups
Refreshes the list of items.
Populates the list view with symbols of the current type with the given names.
Populate combo box with known style items (symbols, color ramps).
Deprecated since version QGIS: 3.6
Deprecated since version QGIS: 3.6
Remove selected symbols from favorites
Removes the selected tag or smartgroup.
Removes the current selected item.
Deprecated since version QGIS: 3.6
Perform tasks when the selected symbols change
Sets the base
name
for the style, which is used by the dialog to reflect the original style/XML file name.sets the text of the item with bold font
Sets whether the favorites group should be shown.
Sets whether smart groups should be shown.
Deprecated since version QGIS: 3.6
Opens the associated help
Perform symbol specific tasks when selected
Tag selected symbols using menu item selection
Toggles the interactive item tagging mode.
- 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 validQgsColorRamp.type()
value then a new ramp of that type will be created. Iftype
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 validQgsColorRamp.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
- exportItemsPNG(self)¶
Triggers the dialog to export selected items as PNG files.
See also
See also
- exportItemsSVG(self)¶
Triggers the dialog to export selected items as SVG files.
See also
See also
- exportSelectedItemsImages(self, dir: str, format: str, size: QSize)¶
Triggers the dialog to export selected items as images of the specified
format
andsize
.See also
See also
- 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
- 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
- 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)¶