QGIS API Documentation 3.27.0-Master (c6eca784ad)
Classes | Public Slots | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Slots | Protected Member Functions | Friends | List of all members
QgsStyleManagerDialog Class Reference

A dialog allowing users to customize and populate a QgsStyle. More...

#include <qgsstylemanagerdialog.h>

Inheritance diagram for QgsStyleManagerDialog:
Inheritance graph
[legend]

Public Slots

void activate ()
 Raises, unminimizes and activates this window. More...
 
void addItem ()
 Triggers the dialog for adding a new item, based on the currently selected item type tab. More...
 
int addSmartgroup ()
 Triggers the dialog to add a new smart group. More...
 
int addTag ()
 Triggers the dialog to add a new tag. More...
 
void editItem ()
 Triggers the dialog for editing the current item. More...
 
void editSmartgroupAction ()
 Triggers the dialog for editing the selected smart group. More...
 
void exportItems ()
 Triggers the dialog to export items. More...
 
void exportItemsPNG ()
 Triggers the dialog to export selected items as PNG files. More...
 
void exportItemsSVG ()
 Triggers the dialog to export selected items as SVG files. More...
 
void exportSelectedItemsImages (const QString &dir, const QString &format, QSize size)
 Triggers the dialog to export selected items as images of the specified format and size. More...
 
void filterSymbols (const QString &filter)
 Sets the filter string to filter symbols by. More...
 
void groupChanged (const QModelIndex &)
 Triggered when the current group (or tag) is changed. More...
 
void groupRenamed (QStandardItem *item)
 Triggered when a group item is renamed. More...
 
void grouptreeContextMenu (QPoint)
 Context menu for the groupTree. More...
 
void importItems ()
 Triggers the dialog to import items. More...
 
Q_DECL_DEPRECATED void itemChanged (QStandardItem *item)
 
void listitemsContextMenu (QPoint)
 Context menu for the listItems ( symbols list ) More...
 
void onClose ()
 Closes the dialog. More...
 
void onFinished ()
 Called when the dialog is going to be closed. More...
 
void populateList ()
 Refreshes the list of items. More...
 
Q_DECL_DEPRECATED void regrouped (QStandardItem *)
 
void removeGroup ()
 Removes the selected tag or smartgroup. More...
 
void removeItem ()
 Removes the current selected item. More...
 
void selectedSymbolsChanged (const QItemSelection &selected, const QItemSelection &deselected)
 Perform tasks when the selected symbols change. More...
 
void showHelp ()
 Opens the associated help. More...
 
void symbolSelected (const QModelIndex &)
 Perform symbol specific tasks when selected. More...
 
void tagSymbolsAction ()
 Toggles the interactive item tagging mode. More...
 

Public Member Functions

 QgsStyleManagerDialog (QgsStyle *style, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags(), bool readOnly=false)
 Constructor for QgsStyleManagerDialog, with the specified parent widget and window flags. More...
 
 QgsStyleManagerDialog (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
 Constructor for QgsStyleManagerDialog, with the specified parent widget and window flags. More...
 
void setBaseStyleName (const QString &name)
 Sets the base name for the style, which is used by the dialog to reflect the original style/XML file name. More...
 
void setFavoritesGroupVisible (bool show)
 Sets whether the favorites group should be shown. More...
 
void setSmartGroupsVisible (bool show)
 Sets whether smart groups should be shown. More...
 

Static Public Member Functions

static QString addColorRampStatic (QWidget *parent, QgsStyle *style, const QString &RampType=QString())
 Opens the add color ramp dialog, returning the new color ramp's name if the ramp has been added. More...
 

Static Public Attributes

static const QgsSettingsEntryString settingLastStyleDatabaseFolder = QgsSettingsEntryString( QStringLiteral( "last-style-database-folder" ), QgsSettings::Prefix::STYLE_MANAGER, QString(), QStringLiteral( "Last used folder for style databases" ) )
 Last used folder for generic style database actions. More...
 

Protected Slots

bool addColorRamp (const QString &type=QString())
 Triggers adding a new color ramp. More...
 
void addFavoriteSelectedSymbols ()
 Add selected symbols to favorites. More...
 
void detagSelectedSymbols ()
 Remove all tags from selected symbols. More...
 
void removeFavoriteSelectedSymbols ()
 Remove selected symbols from favorites. More...
 
void tagSelectedSymbols (bool newTag=false)
 Tag selected symbols using menu item selection. More...
 

Protected Member Functions

bool addSymbol (int symbolType=-1)
 add a new symbol to style More...
 
QString currentItemName ()
 
int currentItemType ()
 
bool editColorRamp ()
 
bool editSymbol ()
 
void enableGroupInputs (bool)
 Enables or disables the groupTree specific inputs. More...
 
void enableItemsForGroupingMode (bool)
 Enables or disables the groupTree items for grouping mode. More...
 
void enableSymbolInputs (bool)
 Enables or disbables the symbol specific inputs. More...
 
Q_DECL_DEPRECATED void populateColorRamps (const QStringList &colorRamps, bool checkable=false)
 Populates the list view with color ramps of the current type with the given names. More...
 
void populateGroups ()
 populate the groups More...
 
Q_DECL_DEPRECATED void populateSymbols (const QStringList &symbolNames, bool checkable=false)
 Populates the list view with symbols of the current type with the given names. More...
 
Q_DECL_DEPRECATED void populateTypes ()
 Populate combo box with known style items (symbols, color ramps). More...
 
Q_DECL_DEPRECATED bool removeColorRamp ()
 
Q_DECL_DEPRECATED bool removeSymbol ()
 
void setBold (QStandardItem *)
 sets the text of the item with bold font More...
 
Q_DECL_DEPRECATED void setSymbolsChecked (const QStringList &)
 

Friends

class QgsStyleExportImportDialog
 

Detailed Description

A dialog allowing users to customize and populate a QgsStyle.

Definition at line 70 of file qgsstylemanagerdialog.h.

Constructor & Destructor Documentation

◆ QgsStyleManagerDialog() [1/2]

QgsStyleManagerDialog::QgsStyleManagerDialog ( QgsStyle style,
QWidget *  parent = nullptr,
Qt::WindowFlags  flags = Qt::WindowFlags(),
bool  readOnly = 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.

Definition at line 176 of file qgsstylemanagerdialog.cpp.

◆ QgsStyleManagerDialog() [2/2]

QgsStyleManagerDialog::QgsStyleManagerDialog ( QWidget *  parent = nullptr,
Qt::WindowFlags  flags = Qt::WindowFlags() 
)

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

All styles linked to the current project will be available.

Since
QGIS 3.26

Definition at line 185 of file qgsstylemanagerdialog.cpp.

Member Function Documentation

◆ activate

void QgsStyleManagerDialog::activate ( )
slot

Raises, unminimizes and activates this window.

Since
QGIS 3.4

Definition at line 1677 of file qgsstylemanagerdialog.cpp.

◆ addColorRamp

bool QgsStyleManagerDialog::addColorRamp ( const QString &  type = QString())
protectedslot

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.

Definition at line 1684 of file qgsstylemanagerdialog.cpp.

◆ addColorRampStatic()

QString QgsStyleManagerDialog::addColorRampStatic ( QWidget *  parent,
QgsStyle style,
const QString &  RampType = QString() 
)
static

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.

Definition at line 1508 of file qgsstylemanagerdialog.cpp.

◆ addFavoriteSelectedSymbols

void QgsStyleManagerDialog::addFavoriteSelectedSymbols ( )
protectedslot

Add selected symbols to favorites.

Definition at line 2891 of file qgsstylemanagerdialog.cpp.

◆ addItem

void QgsStyleManagerDialog::addItem ( )
slot

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

Definition at line 1363 of file qgsstylemanagerdialog.cpp.

◆ addSmartgroup

int QgsStyleManagerDialog::addSmartgroup ( )
slot

Triggers the dialog to add a new smart group.

Definition at line 2571 of file qgsstylemanagerdialog.cpp.

◆ addSymbol()

bool QgsStyleManagerDialog::addSymbol ( int  symbolType = -1)
protected

add a new symbol to style

Definition at line 1404 of file qgsstylemanagerdialog.cpp.

◆ addTag

int QgsStyleManagerDialog::addTag ( )
slot

Triggers the dialog to add a new tag.

Definition at line 2518 of file qgsstylemanagerdialog.cpp.

◆ currentItemName()

QString QgsStyleManagerDialog::currentItemName ( )
protected

Definition at line 1354 of file qgsstylemanagerdialog.cpp.

◆ currentItemType()

int QgsStyleManagerDialog::currentItemType ( )
protected

Definition at line 1329 of file qgsstylemanagerdialog.cpp.

◆ detagSelectedSymbols

void QgsStyleManagerDialog::detagSelectedSymbols ( )
protectedslot

Remove all tags from selected symbols.

Definition at line 2944 of file qgsstylemanagerdialog.cpp.

◆ editColorRamp()

bool QgsStyleManagerDialog::editColorRamp ( )
protected

Definition at line 1753 of file qgsstylemanagerdialog.cpp.

◆ editItem

void QgsStyleManagerDialog::editItem ( )
slot

Triggers the dialog for editing the current item.

Definition at line 1698 of file qgsstylemanagerdialog.cpp.

◆ editSmartgroupAction

void QgsStyleManagerDialog::editSmartgroupAction ( )
slot

Triggers the dialog for editing the selected smart group.

Definition at line 2961 of file qgsstylemanagerdialog.cpp.

◆ editSymbol()

bool QgsStyleManagerDialog::editSymbol ( )
protected

Definition at line 1730 of file qgsstylemanagerdialog.cpp.

◆ enableGroupInputs()

void QgsStyleManagerDialog::enableGroupInputs ( bool  enable)
protected

Enables or disables the groupTree specific inputs.

Definition at line 2786 of file qgsstylemanagerdialog.cpp.

◆ enableItemsForGroupingMode()

void QgsStyleManagerDialog::enableItemsForGroupingMode ( bool  enable)
protected

Enables or disables the groupTree items for grouping mode.

Definition at line 2793 of file qgsstylemanagerdialog.cpp.

◆ enableSymbolInputs()

void QgsStyleManagerDialog::enableSymbolInputs ( bool  enable)
protected

Enables or disbables the symbol specific inputs.

Definition at line 2773 of file qgsstylemanagerdialog.cpp.

◆ exportItems

void QgsStyleManagerDialog::exportItems ( )
slot

Triggers the dialog to export items.

See also
importItems()

Definition at line 2329 of file qgsstylemanagerdialog.cpp.

◆ exportItemsPNG

void QgsStyleManagerDialog::exportItemsPNG ( )
slot

Triggers the dialog to export selected items as PNG files.

See also
exportItemsSVG()
exportSelectedItemsImages()

Definition at line 2294 of file qgsstylemanagerdialog.cpp.

◆ exportItemsSVG

void QgsStyleManagerDialog::exportItemsSVG ( )
slot

Triggers the dialog to export selected items as SVG files.

See also
exportItemsPNG()
exportSelectedItemsImages()

Definition at line 2302 of file qgsstylemanagerdialog.cpp.

◆ exportSelectedItemsImages

void QgsStyleManagerDialog::exportSelectedItemsImages ( const QString &  dir,
const QString &  format,
QSize  size 
)
slot

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

See also
exportItemsSVG()
exportItemsPNG()

Definition at line 2311 of file qgsstylemanagerdialog.cpp.

◆ filterSymbols

void QgsStyleManagerDialog::filterSymbols ( const QString &  filter)
slot

Sets the filter string to filter symbols by.

Definition at line 2744 of file qgsstylemanagerdialog.cpp.

◆ groupChanged

void QgsStyleManagerDialog::groupChanged ( const QModelIndex &  index)
slot

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

Definition at line 2419 of file qgsstylemanagerdialog.cpp.

◆ groupRenamed

void QgsStyleManagerDialog::groupRenamed ( QStandardItem *  item)
slot

Triggered when a group item is renamed.

Definition at line 2651 of file qgsstylemanagerdialog.cpp.

◆ grouptreeContextMenu

void QgsStyleManagerDialog::grouptreeContextMenu ( QPoint  point)
slot

Context menu for the groupTree.

Definition at line 2825 of file qgsstylemanagerdialog.cpp.

◆ importItems

void QgsStyleManagerDialog::importItems ( )
slot

Triggers the dialog to import items.

See also
exportItems()

Definition at line 2335 of file qgsstylemanagerdialog.cpp.

◆ itemChanged

void QgsStyleManagerDialog::itemChanged ( QStandardItem *  item)
slot
Deprecated:
since QGIS 3.6 - has no effect and will be removed in QGIS 4.0

Definition at line 2290 of file qgsstylemanagerdialog.cpp.

◆ listitemsContextMenu

void QgsStyleManagerDialog::listitemsContextMenu ( QPoint  point)
slot

Context menu for the listItems ( symbols list )

Definition at line 2834 of file qgsstylemanagerdialog.cpp.

◆ onClose

void QgsStyleManagerDialog::onClose ( )
slot

Closes the dialog.

Definition at line 3003 of file qgsstylemanagerdialog.cpp.

◆ onFinished

void QgsStyleManagerDialog::onFinished ( )
slot

Called when the dialog is going to be closed.

Definition at line 618 of file qgsstylemanagerdialog.cpp.

◆ populateColorRamps()

void QgsStyleManagerDialog::populateColorRamps ( const QStringList &  colorRamps,
bool  checkable = false 
)
protected

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

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

Definition at line 1325 of file qgsstylemanagerdialog.cpp.

◆ populateGroups()

void QgsStyleManagerDialog::populateGroups ( )
protected

populate the groups

Definition at line 2350 of file qgsstylemanagerdialog.cpp.

◆ populateList

void QgsStyleManagerDialog::populateList ( )
slot

Refreshes the list of items.

Definition at line 1316 of file qgsstylemanagerdialog.cpp.

◆ populateSymbols()

void QgsStyleManagerDialog::populateSymbols ( const QStringList &  symbolNames,
bool  checkable = false 
)
protected

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

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

Definition at line 1321 of file qgsstylemanagerdialog.cpp.

◆ populateTypes()

void QgsStyleManagerDialog::populateTypes ( )
protected

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

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

Definition at line 624 of file qgsstylemanagerdialog.cpp.

◆ regrouped

void QgsStyleManagerDialog::regrouped ( QStandardItem *  )
slot
Deprecated:
since QGIS 3.6 - has no effect and will be removed in QGIS 4.0

Definition at line 2736 of file qgsstylemanagerdialog.cpp.

◆ removeColorRamp()

bool QgsStyleManagerDialog::removeColorRamp ( )
protected
Deprecated:
since QGIS 3.6 - has no effect and will be removed in QGIS 4.0

Definition at line 2285 of file qgsstylemanagerdialog.cpp.

◆ removeFavoriteSelectedSymbols

void QgsStyleManagerDialog::removeFavoriteSelectedSymbols ( )
protectedslot

Remove selected symbols from favorites.

Definition at line 2903 of file qgsstylemanagerdialog.cpp.

◆ removeGroup

void QgsStyleManagerDialog::removeGroup ( )
slot

Removes the selected tag or smartgroup.

Definition at line 2612 of file qgsstylemanagerdialog.cpp.

◆ removeItem

void QgsStyleManagerDialog::removeItem ( )
slot

Removes the current selected item.

Definition at line 2203 of file qgsstylemanagerdialog.cpp.

◆ removeSymbol()

bool QgsStyleManagerDialog::removeSymbol ( )
protected
Deprecated:
since QGIS 3.6 - has no effect and will be removed in QGIS 4.0

Definition at line 2280 of file qgsstylemanagerdialog.cpp.

◆ selectedSymbolsChanged

void QgsStyleManagerDialog::selectedSymbolsChanged ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
slot

Perform tasks when the selected symbols change.

Definition at line 2754 of file qgsstylemanagerdialog.cpp.

◆ setBaseStyleName()

void QgsStyleManagerDialog::setBaseStyleName ( const QString &  name)

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

Since
QGIS 3.6

Definition at line 1672 of file qgsstylemanagerdialog.cpp.

◆ setBold()

void QgsStyleManagerDialog::setBold ( QStandardItem *  item)
protected

sets the text of the item with bold font

Definition at line 2343 of file qgsstylemanagerdialog.cpp.

◆ setFavoritesGroupVisible()

void QgsStyleManagerDialog::setFavoritesGroupVisible ( bool  show)

Sets whether the favorites group should be shown.

The default is to show the group.

Since
QGIS 3.6

Definition at line 1660 of file qgsstylemanagerdialog.cpp.

◆ setSmartGroupsVisible()

void QgsStyleManagerDialog::setSmartGroupsVisible ( bool  show)

Sets whether smart groups should be shown.

The default is to show the groups.

Since
QGIS 3.6

Definition at line 1666 of file qgsstylemanagerdialog.cpp.

◆ setSymbolsChecked()

void QgsStyleManagerDialog::setSymbolsChecked ( const QStringList &  )
protected
Deprecated:
since QGIS 3.6 - has no effect and will be removed in QGIS 4.0

Definition at line 2740 of file qgsstylemanagerdialog.cpp.

◆ showHelp

void QgsStyleManagerDialog::showHelp ( )
slot

Opens the associated help.

Definition at line 3008 of file qgsstylemanagerdialog.cpp.

◆ symbolSelected

void QgsStyleManagerDialog::symbolSelected ( const QModelIndex &  index)
slot

Perform symbol specific tasks when selected.

Definition at line 2749 of file qgsstylemanagerdialog.cpp.

◆ tagSelectedSymbols

void QgsStyleManagerDialog::tagSelectedSymbols ( bool  newTag = false)
protectedslot

Tag selected symbols using menu item selection.

Definition at line 2915 of file qgsstylemanagerdialog.cpp.

◆ tagSymbolsAction

void QgsStyleManagerDialog::tagSymbolsAction ( )
slot

Toggles the interactive item tagging mode.

Definition at line 2671 of file qgsstylemanagerdialog.cpp.

Friends And Related Function Documentation

◆ QgsStyleExportImportDialog

friend class QgsStyleExportImportDialog
friend

Definition at line 485 of file qgsstylemanagerdialog.h.

Member Data Documentation

◆ settingLastStyleDatabaseFolder

const QgsSettingsEntryString QgsStyleManagerDialog::settingLastStyleDatabaseFolder = QgsSettingsEntryString( QStringLiteral( "last-style-database-folder" ), QgsSettings::Prefix::STYLE_MANAGER, QString(), QStringLiteral( "Last used folder for style databases" ) )
inlinestatic

Last used folder for generic style database actions.

Since
QGIS 3.26

Definition at line 81 of file qgsstylemanagerdialog.h.


The documentation for this class was generated from the following files: