16#ifndef QGSSTYLEV2MANAGERDIALOG_H
17#define QGSSTYLEV2MANAGERDIALOG_H
19#include "ui_qgsstylemanagerdialogbase.h"
29#include <QStandardItem>
43 explicit QgsCheckableStyleModel( QgsStyleModel *sourceModel, QObject *parent =
nullptr,
bool readOnly =
false );
44 explicit QgsCheckableStyleModel( QgsStyle *style, QObject *parent =
nullptr,
bool readOnly =
false );
46 void setCheckable(
bool checkable );
47 void setCheckTag(
const QString &tag );
49 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
50 QVariant data(
const QModelIndex &index,
int role )
const override;
51 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
54 QgsStyle *mStyle =
nullptr;
55 bool mCheckable =
false;
57 bool mReadOnly =
false;
356 void setBold( QStandardItem * );
360 void tabItemType_currentChanged(
int );
362 void copyItemsToDefault();
368 void setThumbnailSize(
int );
370 void currentStyleAboutToBeDestroyed();
375 void setCurrentStyle(
QgsStyle *style );
376 int selectedItemType();
381 bool allTypesSelected() const;
383 bool isReadOnly() const;
394 Name = Qt::UserRole + 1,
398 QList<ItemDetails> selectedItems();
403 static int copyItems(
const QList<ItemDetails> &items, QgsStyle *src, QgsStyle *dst, QWidget *parentWidget, std::unique_ptr<QgsTemporaryCursorOverride> &cursorOverride,
bool isImport,
const QStringList &importTags,
bool addToFavorites,
bool ignoreSourceTags );
405 QgsMessageBar *mMessageBar =
nullptr;
407 QgsStyle *mStyle =
nullptr;
409 QgsCheckableStyleModel *mModel =
nullptr;
411 QgsProjectStyleDatabaseModel *mProjectStyleModel =
nullptr;
413 QString mStyleFilename;
415 bool mModified =
false;
418 bool mGroupingMode =
false;
421 QStringList mTagList;
423 QMenu *mShareMenu =
nullptr;
426 QMenu *mGroupMenu =
nullptr;
429 QMenu *mGroupListMenu =
nullptr;
432 QMenu *mGroupTreeContextMenu =
nullptr;
435 QMenu *mMenuBtnAddItemColorRamp =
nullptr;
438 QMenu *mMenuBtnAddItemAll =
nullptr;
441 QMenu *mMenuBtnAddItemLabelSettings =
nullptr;
444 QMenu *mMenuBtnAddItemLegendPatchShape =
nullptr;
447 QMenu *mMenuBtnAddItemSymbol3D =
nullptr;
449 QAction *mActionCopyToDefault =
nullptr;
451 QAction *mActionCopyItem =
nullptr;
452 QAction *mActionPasteItem =
nullptr;
453 QAction *mExportAction =
nullptr;
454 QAction *mImportAction =
nullptr;
456 int mBlockGroupUpdates = 0;
457 int mBlockStyleDatabaseChanges = 0;
459 bool mReadOnly =
false;
460 bool mFavoritesGroupVisible =
true;
461 bool mSmartGroupVisible =
true;
464 static QString sPreviousTag;
466 bool addTextFormat();
467 bool editTextFormat();
470 bool editLabelSettings();
473 bool editLegendPatchShape();
475 bool addSymbol3D(
const QString &type );
478 void addStyleDatabase(
bool createNew );
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
A bar for displaying non-blocking messages to the user.
List model representing the style databases associated with a QgsProject.
A tree node for the settings tree to help organizing and introspecting the tree.
static QgsSettingsTreeNode * sTreeApp
Q_DECL_DEPRECATED bool removeSymbol()
void onClose()
Closes the dialog.
void groupRenamed(QStandardItem *item)
Triggered when a group item is renamed.
static const QgsSettingsEntryString * settingLastStyleDatabaseFolder
Last used folder for generic style database actions.
void addFavoriteSelectedSymbols()
Add selected symbols to favorites.
void selectedSymbolsChanged(const QItemSelection &selected, const QItemSelection &deselected)
Perform tasks when the selected symbols change.
void removeGroup()
Removes the selected tag or smartgroup.
void exportItems()
Triggers the dialog to export items.
friend class QgsStyleExportImportDialog
static QgsSettingsTreeNode * sTtreeStyleManager
void setFavoritesGroupVisible(bool show)
Sets whether the favorites group should be shown.
void grouptreeContextMenu(QPoint)
Context menu for the groupTree.
void setBold(QStandardItem *)
sets the text of the item with bold font
void filterSymbols(const QString &filter)
Sets the filter string to filter symbols by.
void addItem()
Triggers the dialog for adding a new item, based on the currently selected item type tab.
void tagSymbolsAction()
Toggles the interactive item tagging mode.
void editSmartgroupAction()
Triggers the dialog for editing the selected smart group.
void showHelp()
Opens the associated help.
void detagSelectedSymbols()
Remove all tags from selected symbols.
void enableSymbolInputs(bool)
Enables or disbables the symbol specific inputs.
bool addSymbol(int symbolType=-1)
add a new symbol to style
Q_DECL_DEPRECATED void populateTypes()
Populate combo box with known style items (symbols, color ramps).
void populateList()
Refreshes the list of items.
void removeItem()
Removes the current selected item.
void groupChanged(const QModelIndex &)
Triggered when the current group (or tag) is changed.
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.
void enableGroupInputs(bool)
Enables or disables the groupTree specific inputs.
int addTag()
Triggers the dialog to add a new tag.
void exportItemsSVG()
Triggers the dialog to export selected items as SVG files.
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.
void populateGroups()
populate the groups
Q_DECL_DEPRECATED bool removeColorRamp()
void importItems()
Triggers the dialog to import items.
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 ...
Q_DECL_DEPRECATED void regrouped(QStandardItem *)
Q_DECL_DEPRECATED void itemChanged(QStandardItem *item)
void exportItemsPNG()
Triggers the dialog to export selected items as PNG files.
void activate()
Raises, unminimizes and activates this window.
bool addColorRamp(const QString &type=QString())
Triggers adding a new color ramp.
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.
void enableItemsForGroupingMode(bool)
Enables or disables the groupTree items for grouping mode.
Q_DECL_DEPRECATED void setSymbolsChecked(const QStringList &)
void onFinished()
Called when the dialog is going to be closed.
void listitemsContextMenu(QPoint)
Context menu for the listItems ( symbols list ).
void setSmartGroupsVisible(bool show)
Sets whether smart groups should be shown.
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.
void symbolSelected(const QModelIndex &)
Perform symbol specific tasks when selected.
void editItem()
Triggers the dialog for editing the current item.
void removeFavoriteSelectedSymbols()
Remove selected symbols from favorites.
int addSmartgroup()
Triggers the dialog to add a new smart group.
void tagSelectedSymbols(bool newTag=false)
Tag selected symbols using menu item selection.
QString currentItemName()
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.
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle ...
A database of saved style entities, including symbols, color ramps, text formats and others.
StyleEntity
Enum for Entities involved in a style.
Temporarily sets a cursor override for the QApplication for the lifetime of the object.