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;
355 void setBold( QStandardItem * );
359 void tabItemType_currentChanged(
int );
361 void copyItemsToDefault();
367 void setThumbnailSize(
int );
369 void currentStyleAboutToBeDestroyed();
374 void setCurrentStyle(
QgsStyle *style );
375 int selectedItemType();
380 bool allTypesSelected() const;
382 bool isReadOnly() const;
393 Name = Qt::UserRole + 1,
397 QList<ItemDetails> selectedItems();
402 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 );
404 QgsMessageBar *mMessageBar =
nullptr;
406 QgsStyle *mStyle =
nullptr;
408 QgsCheckableStyleModel *mModel =
nullptr;
410 QgsProjectStyleDatabaseModel *mProjectStyleModel =
nullptr;
412 QString mStyleFilename;
414 bool mModified =
false;
417 bool mGroupingMode =
false;
420 QStringList mTagList;
422 QMenu *mShareMenu =
nullptr;
425 QMenu *mGroupMenu =
nullptr;
428 QMenu *mGroupListMenu =
nullptr;
431 QMenu *mGroupTreeContextMenu =
nullptr;
434 QMenu *mMenuBtnAddItemColorRamp =
nullptr;
437 QMenu *mMenuBtnAddItemAll =
nullptr;
440 QMenu *mMenuBtnAddItemLabelSettings =
nullptr;
443 QMenu *mMenuBtnAddItemLegendPatchShape =
nullptr;
446 QMenu *mMenuBtnAddItemSymbol3D =
nullptr;
448 QAction *mActionCopyToDefault =
nullptr;
450 QAction *mActionCopyItem =
nullptr;
451 QAction *mActionPasteItem =
nullptr;
452 QAction *mExportAction =
nullptr;
453 QAction *mImportAction =
nullptr;
455 int mBlockGroupUpdates = 0;
456 int mBlockStyleDatabaseChanges = 0;
458 bool mReadOnly =
false;
459 bool mFavoritesGroupVisible =
true;
460 bool mSmartGroupVisible =
true;
463 static QString sPreviousTag;
465 bool addTextFormat();
466 bool editTextFormat();
469 bool editLabelSettings();
472 bool editLegendPatchShape();
474 bool addSymbol3D(
const QString &type );
477 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.