16#ifndef QGSSTYLEV2MANAGERDIALOG_H
17#define QGSSTYLEV2MANAGERDIALOG_H
19#include "ui_qgsstylemanagerdialogbase.h"
29#include <QStandardItem>
32using namespace Qt::StringLiterals;
46 explicit QgsCheckableStyleModel( QgsStyleModel *sourceModel, QObject *parent =
nullptr,
bool readOnly =
false );
47 explicit QgsCheckableStyleModel( QgsStyle *style, QObject *parent =
nullptr,
bool readOnly =
false );
49 void setCheckable(
bool checkable );
50 void setCheckTag(
const QString &tag );
52 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
53 QVariant data(
const QModelIndex &index,
int role )
const override;
54 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
57 QgsStyle *mStyle =
nullptr;
58 bool mCheckable =
false;
60 bool mReadOnly =
false;
358 void setBold( QStandardItem * );
362 void tabItemType_currentChanged(
int );
364 void copyItemsToDefault();
370 void setThumbnailSize(
int );
372 void currentStyleAboutToBeDestroyed();
377 void setCurrentStyle(
QgsStyle *style );
378 int selectedItemType();
383 bool allTypesSelected() const;
385 bool isReadOnly() const;
396 Name = Qt::UserRole + 1,
400 QList<ItemDetails> selectedItems();
405 static int copyItems(
406 const QList<ItemDetails> &items,
409 QWidget *parentWidget,
410 std::unique_ptr<QgsTemporaryCursorOverride> &cursorOverride,
412 const QStringList &importTags,
414 bool ignoreSourceTags
417 QgsMessageBar *mMessageBar =
nullptr;
419 QgsStyle *mStyle =
nullptr;
421 QgsCheckableStyleModel *mModel =
nullptr;
423 QgsProjectStyleDatabaseModel *mProjectStyleModel =
nullptr;
425 QString mStyleFilename;
427 bool mModified =
false;
430 bool mGroupingMode =
false;
433 QStringList mTagList;
435 QMenu *mShareMenu =
nullptr;
438 QMenu *mGroupMenu =
nullptr;
441 QMenu *mGroupListMenu =
nullptr;
444 QMenu *mGroupTreeContextMenu =
nullptr;
447 QMenu *mMenuBtnAddItemColorRamp =
nullptr;
450 QMenu *mMenuBtnAddItemAll =
nullptr;
453 QMenu *mMenuBtnAddItemLabelSettings =
nullptr;
456 QMenu *mMenuBtnAddItemLegendPatchShape =
nullptr;
459 QMenu *mMenuBtnAddItemSymbol3D =
nullptr;
461 QAction *mActionCopyToDefault =
nullptr;
463 QAction *mActionCopyItem =
nullptr;
464 QAction *mActionPasteItem =
nullptr;
465 QAction *mExportAction =
nullptr;
466 QAction *mImportAction =
nullptr;
468 int mBlockGroupUpdates = 0;
469 int mBlockStyleDatabaseChanges = 0;
471 bool mReadOnly =
false;
472 bool mFavoritesGroupVisible =
true;
473 bool mSmartGroupVisible =
true;
476 static QString sPreviousTag;
478 bool addTextFormat();
479 bool editTextFormat();
482 bool editLabelSettings();
485 bool editLegendPatchShape();
487 bool addSymbol3D(
const QString &type );
490 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.