QGIS API Documentation  2.99.0-Master (d55fa22)
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_sip.h"
21 #include "qgis_gui.h"
22 
26 class GUI_EXPORT QgsSmartGroupCondition : public QWidget, private Ui::QgsSmartGroupConditionWidget
27 {
28  Q_OBJECT
29 
30  public:
31  QgsSmartGroupCondition( int id, QWidget *parent = nullptr );
32 
34  QString constraint();
35 
37  QString parameter();
38 
40  void setConstraint( const QString &constraint );
41 
43  void setParameter( const QString &param );
44 
46  void hideRemoveButton( bool hide );
47 
48  public slots:
49  void destruct();
50 
51  signals:
52  void removed( int );
53 
54  protected:
56 
57 };
58 
59 
60 #include <QDialog>
61 
62 #include "ui_qgssmartgroupeditordialogbase.h"
63 //#include "qgscontexthelp.h"
64 
65 #include "qgsstyle.h" //for QgsSmartConditionMap
66 
70 class GUI_EXPORT QgsSmartGroupEditorDialog : public QDialog, private Ui::QgsSmartGroupEditorDialogBase
71 {
72  Q_OBJECT
73 
74  public:
75  QgsSmartGroupEditorDialog( QgsStyle *style, QWidget *parent = nullptr );
76 
78  QString smartgroupName();
79 
82  QgsSmartConditionMap conditionMap() SIP_SKIP;
83 
85  QString conditionOperator();
86 
89  void setConditionMap( const QgsSmartConditionMap & ) SIP_SKIP;
90 
92  void setOperator( const QString & );
93 
95  void setSmartgroupName( const QString & );
96 
97  public slots:
98 
100  void addCondition();
101 
103  void removeCondition( int );
104 
105  void on_buttonBox_accepted();
106 
107  protected:
108  QgsStyle *mStyle = nullptr;
109  // layout of the mConditionsBox
110  QGridLayout *mLayout = nullptr;
111  // counter for the number of conditions
113  // map tracking the condition widget and the ids
114  QMap<int, QgsSmartGroupCondition *> mConditionMap;
115 };
116 
117 #endif // QGSSMARTGROUPEDITORDIALOG_H
QMap< int, QgsSmartGroupCondition * > mConditionMap
#define SIP_SKIP
Definition: qgis_sip.h:87
QMultiMap< QString, QString > QgsSmartConditionMap
A multimap to hold the smart group conditions as constraint and parameter pairs.
Definition: qgsstyle.h:56