-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgsattributetypedialog.h
156 lines (123 loc) · 4.32 KB
/
qgsattributetypedialog.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/***************************************************************************
qgsattributetypedialog.h - description
-------------------
begin : June 2009
copyright : (C) 2009 by Richard Kostecky
email : csf.kostej@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 QGSATTRIBUTETYPEDIALOG_H
#define QGSATTRIBUTETYPEDIALOG_H
#include "ui_qgsattributetypeedit.h"
#include "qgsvectorlayer.h"
#include "qgseditorconfigwidget.h"
#include "qgsfeature.h"
class QDialog;
class QLayout;
class QgsField;
class APP_EXPORT QgsAttributeTypeDialog: public QDialog, private Ui::QgsAttributeTypeDialog
{
Q_OBJECT
public:
QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx );
~QgsAttributeTypeDialog();
/**
* Setting index, which page should be selected
* @param index of page to be selected
* @param editTypeInt type of edit type which was selected before save
*/
void setIndex( int index, QgsVectorLayer::EditType type );
/**
* Setting page which is to be selected
* @param index index of page which was selected
*/
void setPage( int index );
/**
* Getter to get selected edit type
* @return selected edit type
*/
QgsVectorLayer::EditType type();
const QString editorWidgetV2Type();
const QString editorWidgetV2Text();
void setWidgetV2Type( const QString& type );
const QgsEditorWidgetConfig editorWidgetV2Config();
void setWidgetV2Config( const QgsEditorWidgetConfig& config );
/**
* Setter for checkbox to label on top
* @param bool onTop
*/
void setLabelOnTop( bool onTop );
/**
* Getter for checkbox for label on top of field
*/
bool labelOnTop() const;
/**
* Setter for checkbox for editable state of field
*/
void setFieldEditable( bool editable );
/**
* Getter for checkbox for editable state of field
*/
bool fieldEditable() const;
/**
* Setter for checkbox for not null
*/
void setNotNull( bool notNull );
/**
* Getter for checkbox for not null
*/
bool notNull() const;
/**
* Setter for constraint expression description
* @param desc the expression description
* @note added in QGIS 2.16
**/
void setConstraintExpressionDescription( const QString &desc );
/**
* Getter for constraint expression description
* @return the expression description
* @note added in QGIS 2.16
**/
QString constraintExpressionDescription();
/**
* Getter for the constraint expression
* @note added in QGIS 2.16
*/
QString constraintExpression() const;
/**
* Setter for the constraint expression
* @note added in QGIS 2.16
*/
void setConstraintExpression( const QString &str );
/**
* Returns the expression used for the field's default value, or
* an empty string if no default value expression is set.
*/
QString defaultValueExpression() const;
/**
* Sets the expression used for the field's default value
*/
void setDefaultValueExpression( const QString& expression );
private slots:
/**
* Slot to handle change of index in combobox to select correct page
* @param index index of value in combobox
*/
void on_selectionListWidget_currentRowChanged( int index );
void defaultExpressionChanged();
private:
QgsVectorLayer *mLayer;
int mFieldIdx;
QgsEditorWidgetConfig mWidgetV2Config;
//! Cached configuration dialog (lazy loaded)
QMap< QString, QgsEditorConfigWidget* > mEditorConfigWidgets;
QgsFeature mPreviewFeature;
};
#endif