QGIS API Documentation  2.99.0-Master (f867b65)
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 SIP_TRANSFERTHIS = 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 
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 SIP_TRANSFERTHIS = nullptr );
75 
77  QString smartgroupName();
78 
81  QgsSmartConditionMap conditionMap() SIP_SKIP;
82 
84  QString conditionOperator();
85 
88  void setConditionMap( const QgsSmartConditionMap & ) SIP_SKIP;
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
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
QMap< int, QgsSmartGroupCondition * > mConditionMap
#define SIP_SKIP
Definition: qgis_sip.h:119
QMultiMap< QString, QString > QgsSmartConditionMap
A multimap to hold the smart group conditions as constraint and parameter pairs.
Definition: qgsstyle.h:56