QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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
21#include "qgis_gui.h"
22#include "qgis_sip.h"
23
29class GUI_EXPORT QgsSmartGroupCondition : public QWidget, private Ui::QgsSmartGroupConditionWidget
30{
31 Q_OBJECT
32
33 public:
34 QgsSmartGroupCondition( int id, QWidget *parent SIP_TRANSFERTHIS = nullptr );
35
37 QString constraint();
38
40 QString parameter();
41
43 void setConstraint( const QString &constraint );
44
46 void setParameter( const QString &param );
47
49 void hideRemoveButton( bool hide );
50
51 public slots:
52 void destruct();
53
54 signals:
55
59 void removed( int id );
60
61 protected:
63};
64
65
66#include <QDialog>
67
68#include "ui_qgssmartgroupeditordialogbase.h"
69
70#include "qgsstyle.h" //for QgsSmartConditionMap
71
77class GUI_EXPORT QgsSmartGroupEditorDialog : public QDialog, private Ui::QgsSmartGroupEditorDialogBase
78{
79 Q_OBJECT
80
81 public:
82 QgsSmartGroupEditorDialog( QgsStyle *style, QWidget *parent SIP_TRANSFERTHIS = nullptr );
83
85 QString smartgroupName();
86
92
94 QString conditionOperator();
95
101
103 void setOperator( const QString & );
104
106 void setSmartgroupName( const QString & );
107
108 public slots:
109
111 void addCondition();
112
114 void removeCondition( int );
115
116 protected:
117 QgsStyle *mStyle = nullptr;
118 // layout of the mConditionsBox
119 QGridLayout *mLayout = nullptr;
120 // counter for the number of conditions
122 // map tracking the condition widget and the ids
123 QMap<int, QgsSmartGroupCondition *> mConditionMap;
124
125 private slots:
126
127 void buttonBox_accepted();
128};
129
130#endif // QGSSMARTGROUPEDITORDIALOG_H
void setConstraint(const QString &constraint)
sets the given constraint
QgsSmartGroupCondition(int id, QWidget *parent=nullptr)
QString parameter()
returns the parameter
void setParameter(const QString &param)
sets the given param
void removed(int id)
Emitted when the group with the specified id is removed.
void hideRemoveButton(bool hide)
sets the remove button hidden state to 'hide'
QString constraint()
returns the constraint key
void setConditionMap(const QgsSmartConditionMap &)
sets up the GUI for the given conditionmap
QMap< int, QgsSmartGroupCondition * > mConditionMap
QgsSmartConditionMap conditionMap()
returns the condition map
QString smartgroupName()
returns the value from mNameLineEdit
QgsSmartGroupEditorDialog(QgsStyle *style, QWidget *parent=nullptr)
void addCondition()
function to create a new ConditionBox and update UI
void removeCondition(int)
slot to remove the condition with id int
void setSmartgroupName(const QString &)
sets the smart group Name
void setOperator(const QString &)
sets the operator AND/OR
QString conditionOperator()
returns the AND/OR condition
A database of saved style entities, including symbols, color ramps, text formats and others.
Definition qgsstyle.h:88
QMultiMap< QString, QString > QgsSmartConditionMap
A multimap to hold the smart group conditions as constraint and parameter pairs.
Definition qgsstyle.h:79
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_SKIP
Definition qgis_sip.h:134