QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgsstylemanagerdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsstylemanagerdialog.h
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSSTYLEV2MANAGERDIALOG_H
17 #define QGSSTYLEV2MANAGERDIALOG_H
18 
19 #include <QDialog>
20 #include <QStandardItem>
21 #include <QAction>
22 #include <QMenu>
23 
24 #include "ui_qgsstylemanagerdialogbase.h"
25 #include "qgshelp.h"
26 #include "qgis_gui.h"
27 
28 class QgsStyle;
29 
36 class GUI_EXPORT QgsStyleManagerDialog : public QDialog, private Ui::QgsStyleManagerDialogBase
37 {
38  Q_OBJECT
39 
40  public:
41 
49  QgsStyleManagerDialog( QgsStyle *style, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
50 
54  static QString addColorRampStatic( QWidget *parent, QgsStyle *style,
55  QString RampType = QString() );
56 
57  public slots:
58 
63  void activate();
64 
65  void addItem();
66  void editItem();
67  void removeItem();
68  void exportItemsSVG();
69  void exportItemsPNG();
70  void exportSelectedItemsImages( const QString &dir, const QString &format, QSize size );
71  void exportItems();
72  void importItems();
73 
75  void populateList();
76 
78  void onFinished();
79 
81  void onClose();
82 
84  void showHelp();
85 
86  void itemChanged( QStandardItem *item );
87 
88  void groupChanged( const QModelIndex & );
89  void groupRenamed( QStandardItem * );
91  int addTag();
93  int addSmartgroup();
95  void removeGroup();
96 
98  void tagSymbolsAction();
99 
101  void editSmartgroupAction();
102 
104  void regrouped( QStandardItem * );
105 
107  void filterSymbols( const QString & );
108 
110  void symbolSelected( const QModelIndex & );
111 
113  void selectedSymbolsChanged( const QItemSelection &selected, const QItemSelection &deselected );
114 
116  void grouptreeContextMenu( QPoint );
117 
119  void listitemsContextMenu( QPoint );
120 
121  protected slots:
122  bool addColorRamp( QAction *action );
124  void addFavoriteSelectedSymbols();
126  void removeFavoriteSelectedSymbols();
128  void tagSelectedSymbols( bool newTag = false );
130  void detagSelectedSymbols();
131 
132  protected:
133 
135  void populateTypes();
136 
138  void populateGroups();
140  void setSymbolsChecked( const QStringList & );
141 
143  void populateSymbols( const QStringList &symbolNames, bool checkable = false );
144 
146  void populateColorRamps( const QStringList &colorRamps, bool checkable = false );
147 
148  int currentItemType();
149  QString currentItemName();
150 
152  bool addSymbol();
154  bool addColorRamp();
155 
156  bool editSymbol();
157  bool editColorRamp();
158 
159  bool removeSymbol();
160  bool removeColorRamp();
161 
163  void enableSymbolInputs( bool );
165  void enableGroupInputs( bool );
167  void enableItemsForGroupingMode( bool );
168 
170  void setBold( QStandardItem * );
171 
172  private slots:
173 
174  void tabItemType_currentChanged( int );
175 
176  private:
177 
178  QgsStyle *mStyle = nullptr;
179 
180  QString mStyleFilename;
181 
182  bool mModified = false;
183 
185  bool mGrouppingMode = false;
186 
188  QStringList mTagList;
189 
191  QMenu *mGroupMenu = nullptr;
192 
194  QMenu *mGroupListMenu = nullptr;
195 
197  QMenu *mGroupTreeContextMenu = nullptr;
198 
200  QMenu *mMenuBtnAddItemColorRamp = nullptr;
201 
202  int mBlockGroupUpdates = 0;
203 
204 };
205 
206 #endif
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
A dialog allowing users to customize and populate a QgsStyle.