QGIS API Documentation  2.14.0-Essen
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 
29 class GUI_EXPORT QgsStyleV2ManagerDialog : public QDialog, private Ui::QgsStyleV2ManagerDialogBase
30 {
31  Q_OBJECT
32 
33  public:
34  QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* parent = nullptr );
35 
37  static QString addColorRampStatic( QWidget* parent, QgsStyleV2* style,
38  QString RampType = QString() );
39 
40  public slots:
41  void addItem();
42  void editItem();
43  void removeItem();
44  void exportItemsSVG();
45  void exportItemsPNG();
46  void exportSelectedItemsImages( const QString& dir, const QString& format, QSize size );
47  void exportItems();
48  void importItems();
49 
50  void on_tabItemType_currentChanged( int );
52  void populateList();
53 
55  void onFinished();
56 
58 
59  void itemChanged( QStandardItem* item );
60 
61  void groupChanged( const QModelIndex& );
62  void groupRenamed( QStandardItem * );
63  void addGroup();
64  void removeGroup();
65 
67  void groupSymbolsAction();
68 
70  void editSmartgroupAction();
71 
73  void regrouped( QStandardItem* );
74 
76  void filterSymbols( const QString& );
77 
79  void tagsChanged();
80 
82  void symbolSelected( const QModelIndex& );
83 
85  void selectedSymbolsChanged( const QItemSelection& selected, const QItemSelection& deselected );
86 
88  void grouptreeContextMenu( QPoint );
89 
91  void listitemsContextMenu( QPoint );
92 
93  protected slots:
94  bool addColorRamp( QAction* action );
95  void groupSelectedSymbols();
96 
97  protected:
98 
100  void populateTypes();
101 
103  void populateGroups();
105  void buildGroupTree( QStandardItem* &parent );
107  void setSymbolsChecked( const QStringList& );
108 
110  void populateSymbols( const QStringList& symbolNames, bool checkable = false );
111 
113  void populateColorRamps( const QStringList& colorRamps, bool checkable = false );
114 
115  int currentItemType();
116  QString currentItemName();
117 
119  bool addSymbol();
121  bool addColorRamp();
122 
123  bool editSymbol();
124  bool editColorRamp();
125 
126  bool removeSymbol();
127  bool removeColorRamp();
128 
130  void enableSymbolInputs( bool );
132  void enableGroupInputs( bool );
134  void enableItemsForGroupingMode( bool );
135 
137  bool eventFilter( QObject*, QEvent* ) override;
138 
140  void setBold( QStandardItem* );
141 
143 
145 
146  bool mModified;
147 
150 
153 
156 
159 
162 
165 };
166 
167 #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.