/
qgssmartgroupeditordialog.h
114 lines (80 loc) · 3.1 KB
/
qgssmartgroupeditordialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/***************************************************************************
qgssmartgroupeditordialog.h
---------------------------
begin : July 2012
copyright : (C) 2012 by Arunmozhi
email : aruntheguy at gmail.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSSMARTGROUPCONDITION_H
#define QGSSMARTGROUPCONDITION_H
#include "ui_qgssmartgroupconditionwidget.h"
class GUI_EXPORT QgsSmartGroupCondition : public QWidget, private Ui::QgsSmartGroupConditionWidget
{
Q_OBJECT
public:
QgsSmartGroupCondition( int id, QWidget *parent = NULL );
//! returns the constraint key
QString constraint();
//! returns the parameter
QString parameter();
//! sets the given constraint
void setConstraint( QString constraint );
//! sets the given param
void setParameter( QString param );
//! sets the remove button hidden state to 'hide'
void hideRemoveButton( bool hide );
public slots:
void destruct();
signals:
void removed( int );
protected:
int mConditionId;
};
#endif //QGSSMARTGROUPCONDITION
#ifndef QGSSMARTGROUPEDITORDIALOG_H
#define QGSSMARTGROUPEDITORDIALOG_H
#include <QDialog>
#include "ui_qgssmartgroupeditordialogbase.h"
//#include "qgscontexthelp.h"
#include "qgsstylev2.h" //for QgsSmartConditionMap
class GUI_EXPORT QgsSmartGroupEditorDialog : public QDialog, private Ui::QgsSmartGroupEditorDialogBase
{
Q_OBJECT
public:
QgsSmartGroupEditorDialog( QgsStyleV2* style, QWidget* parent = NULL );
~QgsSmartGroupEditorDialog();
//! returns the value from mNameLineEdit
QString smartgroupName();
//! returns the condition map
QgsSmartConditionMap conditionMap();
//! returns the AND/OR condition
QString conditionOperator();
//! sets up the GUI for the given conditionmap
void setConditionMap( QgsSmartConditionMap );
//! sets the operator AND/OR
void setOperator( QString );
//! sets the smart group Name
void setSmartgroupName( QString );
public slots:
//! function to create a new ConditionBox and update UI
void addCondition();
//! slot to remove the condition with id int
void removeCondition( int );
void on_buttonBox_accepted();
protected:
QgsStyleV2* mStyle;
// layout of the mConditionsBox
QGridLayout *mLayout;
// counter for the number of conditions
int mCondCount;
// map tracking the condition widget and the ids
QMap<int,QgsSmartGroupCondition*> mConditionMap;
};
#endif // QGSSMARTGROUPEDITORDIALOG_H