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(
const QList<ItemDetails> &items, QgsStyle *src, QgsStyle *dst, QWidget *parentWidget, std::unique_ptr<QgsTemporaryCursorOverride> &cursorOverride,
bool isImport,
const QStringList &importTags,
bool addToFavorites,
bool ignoreSourceTags );
407 QgsMessageBar *mMessageBar =
nullptr;
409 QgsStyle *mStyle =
nullptr;
411 QgsCheckableStyleModel *mModel =
nullptr;
413 QgsProjectStyleDatabaseModel *mProjectStyleModel =
nullptr;
415 QString mStyleFilename;
417 bool mModified =
false;
420 bool mGroupingMode =
false;
423 QStringList mTagList;
425 QMenu *mShareMenu =
nullptr;
428 QMenu *mGroupMenu =
nullptr;
431 QMenu *mGroupListMenu =
nullptr;
434 QMenu *mGroupTreeContextMenu =
nullptr;
437 QMenu *mMenuBtnAddItemColorRamp =
nullptr;
440 QMenu *mMenuBtnAddItemAll =
nullptr;
443 QMenu *mMenuBtnAddItemLabelSettings =
nullptr;
446 QMenu *mMenuBtnAddItemLegendPatchShape =
nullptr;
449 QMenu *mMenuBtnAddItemSymbol3D =
nullptr;
451 QAction *mActionCopyToDefault =
nullptr;
453 QAction *mActionCopyItem =
nullptr;
454 QAction *mActionPasteItem =
nullptr;
455 QAction *mExportAction =
nullptr;
456 QAction *mImportAction =
nullptr;
458 int mBlockGroupUpdates = 0;
459 int mBlockStyleDatabaseChanges = 0;
461 bool mReadOnly =
false;
462 bool mFavoritesGroupVisible =
true;
463 bool mSmartGroupVisible =
true;
466 static QString sPreviousTag;
468 bool addTextFormat();
469 bool editTextFormat();
472 bool editLabelSettings();
475 bool editLegendPatchShape();
477 bool addSymbol3D(
const QString &type );
480 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.