QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsstylev2managerdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsstylev2managerdialog.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_qgsstylev2managerdialogbase.h"
25 #include "qgscontexthelp.h"
26 
27 class QgsStyleV2;
28 
32 class GUI_EXPORT QgsStyleV2ManagerDialog : public QDialog, private Ui::QgsStyleV2ManagerDialogBase
33 {
34  Q_OBJECT
35 
36  public:
37  QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* parent = nullptr );
38 
40  static QString addColorRampStatic( QWidget* parent, QgsStyleV2* style,
41  QString RampType = QString() );
42 
43  public slots:
44  void addItem();
45  void editItem();
46  void removeItem();
47  void exportItemsSVG();
48  void exportItemsPNG();
49  void exportSelectedItemsImages( const QString& dir, const QString& format, QSize size );
50  void exportItems();
51  void importItems();
52 
53  void on_tabItemType_currentChanged( int );
55  void populateList();
56 
58  void onFinished();
59 
61 
62  void itemChanged( QStandardItem* item );
63 
64  void groupChanged( const QModelIndex& );
65  void groupRenamed( QStandardItem * );
66  void addGroup();
67  void removeGroup();
68 
70  void groupSymbolsAction();
71 
73  void editSmartgroupAction();
74 
76  void regrouped( QStandardItem* );
77 
79  void filterSymbols( const QString& );
80 
82  void tagsChanged();
83 
85  void symbolSelected( const QModelIndex& );
86 
88  void selectedSymbolsChanged( const QItemSelection& selected, const QItemSelection& deselected );
89 
91  void grouptreeContextMenu( QPoint );
92 
94  void listitemsContextMenu( QPoint );
95 
96  protected slots:
97  bool addColorRamp( QAction* action );
98  void groupSelectedSymbols();
99 
100  protected:
101 
103  void populateTypes();
104 
106  void populateGroups();
108  void buildGroupTree( QStandardItem* &parent );
110  void setSymbolsChecked( const QStringList& );
111 
113  void populateSymbols( const QStringList& symbolNames, bool checkable = false );
114 
116  void populateColorRamps( const QStringList& colorRamps, bool checkable = false );
117 
118  int currentItemType();
119  QString currentItemName();
120 
122  bool addSymbol();
124  bool addColorRamp();
125 
126  bool editSymbol();
127  bool editColorRamp();
128 
129  bool removeSymbol();
130  bool removeColorRamp();
131 
133  void enableSymbolInputs( bool );
135  void enableGroupInputs( bool );
137  void enableItemsForGroupingMode( bool );
138 
140  bool eventFilter( QObject*, QEvent* ) override;
141 
143  void setBold( QStandardItem* );
144 
146 
148 
149  bool mModified;
150 
153 
156 
159 
162 
165 
168 };
169 
170 #endif
const char * className() const
QMenu * mMenuBtnAddItemColorRamp
Menu for the "Add item" toolbutton when in colorramp mode.
virtual const QMetaObject * metaObject() const
static void run(const QString &context)
QStringList mTagList
space to store symbol tags
QMenu * mGroupMenu
Context menu for the symbols/colorramps.
QMenu * mGroupTreeContextMenu
Context menu for the group tree.
bool mGrouppingMode
Mode to display the symbol list.
virtual bool eventFilter(QObject *o, QEvent *e)
QMenu * mGroupListMenu
Sub-menu of mGroupMenu, dynamically filled to show one entry for every group.