QGIS API Documentation  3.2.0-Bonn (bc43194)
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 
34 class GUI_EXPORT QgsStyleManagerDialog : public QDialog, private Ui::QgsStyleManagerDialogBase
35 {
36  Q_OBJECT
37 
38  public:
39  QgsStyleManagerDialog( QgsStyle *style, QWidget *parent SIP_TRANSFERTHIS = nullptr );
40 
42  static QString addColorRampStatic( QWidget *parent, QgsStyle *style,
43  QString RampType = QString() );
44 
45  public slots:
46  void addItem();
47  void editItem();
48  void removeItem();
49  void exportItemsSVG();
50  void exportItemsPNG();
51  void exportSelectedItemsImages( const QString &dir, const QString &format, QSize size );
52  void exportItems();
53  void importItems();
54 
56  void populateList();
57 
59  void onFinished();
60 
62  void onClose();
63 
65  void showHelp();
66 
67  void itemChanged( QStandardItem *item );
68 
69  void groupChanged( const QModelIndex & );
70  void groupRenamed( QStandardItem * );
72  int addTag();
74  int addSmartgroup();
76  void removeGroup();
77 
79  void tagSymbolsAction();
80 
82  void editSmartgroupAction();
83 
85  void regrouped( QStandardItem * );
86 
88  void filterSymbols( const QString & );
89 
91  void symbolSelected( const QModelIndex & );
92 
94  void selectedSymbolsChanged( const QItemSelection &selected, const QItemSelection &deselected );
95 
97  void grouptreeContextMenu( QPoint );
98 
100  void listitemsContextMenu( QPoint );
101 
102  protected slots:
103  bool addColorRamp( QAction *action );
105  void addFavoriteSelectedSymbols();
107  void removeFavoriteSelectedSymbols();
109  void tagSelectedSymbols( bool newTag = false );
111  void detagSelectedSymbols();
112 
113  protected:
114 
116  void populateTypes();
117 
119  void populateGroups();
121  void setSymbolsChecked( const QStringList & );
122 
124  void populateSymbols( const QStringList &symbolNames, bool checkable = false );
125 
127  void populateColorRamps( const QStringList &colorRamps, bool checkable = false );
128 
129  int currentItemType();
130  QString currentItemName();
131 
133  bool addSymbol();
135  bool addColorRamp();
136 
137  bool editSymbol();
138  bool editColorRamp();
139 
140  bool removeSymbol();
141  bool removeColorRamp();
142 
144  void enableSymbolInputs( bool );
146  void enableGroupInputs( bool );
148  void enableItemsForGroupingMode( bool );
149 
151  void setBold( QStandardItem * );
152 
153  QgsStyle *mStyle = nullptr;
154 
155  QString mStyleFilename;
156 
157  bool mModified;
158 
161 
163  QStringList mTagList;
164 
166  QMenu *mGroupMenu = nullptr;
167 
169  QMenu *mGroupListMenu = nullptr;
170 
172  QMenu *mGroupTreeContextMenu = nullptr;
173 
175  QMenu *mMenuBtnAddItemColorRamp = nullptr;
176 
177  private slots:
178 
179  void tabItemType_currentChanged( int );
180 };
181 
182 #endif
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
bool mGrouppingMode
Mode to display the symbol list.
QStringList mTagList
space to store symbol tags