QGIS API Documentation  2.99.0-Master (40f86b2)
qgssmartgroupeditordialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssmartgroupeditordialog.h
3  ---------------------------
4  begin : July 2012
5  copyright : (C) 2012 by Arunmozhi
6  email : aruntheguy at gmail.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 QGSSMARTGROUPEDITORDIALOG_H
17 #define QGSSMARTGROUPEDITORDIALOG_H
18 
19 #include "ui_qgssmartgroupconditionwidget.h"
20 #include "qgis_gui.h"
21 
25 class GUI_EXPORT QgsSmartGroupCondition : public QWidget, private Ui::QgsSmartGroupConditionWidget
26 {
27  Q_OBJECT
28 
29  public:
30  QgsSmartGroupCondition( int id, QWidget *parent = nullptr );
31 
33  QString constraint();
34 
36  QString parameter();
37 
39  void setConstraint( const QString &constraint );
40 
42  void setParameter( const QString &param );
43 
45  void hideRemoveButton( bool hide );
46 
47  public slots:
48  void destruct();
49 
50  signals:
51  void removed( int );
52 
53  protected:
55 
56 };
57 
58 
59 #include <QDialog>
60 
61 #include "ui_qgssmartgroupeditordialogbase.h"
62 //#include "qgscontexthelp.h"
63 
64 #include "qgsstyle.h" //for QgsSmartConditionMap
65 
69 class GUI_EXPORT QgsSmartGroupEditorDialog : public QDialog, private Ui::QgsSmartGroupEditorDialogBase
70 {
71  Q_OBJECT
72 
73  public:
74  QgsSmartGroupEditorDialog( QgsStyle *style, QWidget *parent = nullptr );
75 
77  QString smartgroupName();
78 
81  QgsSmartConditionMap conditionMap();
82 
84  QString conditionOperator();
85 
88  void setConditionMap( const QgsSmartConditionMap & );
89 
91  void setOperator( const QString & );
92 
94  void setSmartgroupName( const QString & );
95 
96  public slots:
97 
99  void addCondition();
100 
102  void removeCondition( int );
103 
104  void on_buttonBox_accepted();
105 
106  protected:
107  QgsStyle *mStyle = nullptr;
108  // layout of the mConditionsBox
109  QGridLayout *mLayout = nullptr;
110  // counter for the number of conditions
112  // map tracking the condition widget and the ids
113  QMap<int, QgsSmartGroupCondition *> mConditionMap;
114 };
115 
116 #endif // QGSSMARTGROUPEDITORDIALOG_H
QMap< int, QgsSmartGroupCondition * > mConditionMap
QMultiMap< QString, QString > QgsSmartConditionMap
A multimap to hold the smart group conditions as constraint and parameter pairs.
Definition: qgsstyle.h:55