-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgsattributetypeloaddialog.h
105 lines (85 loc) · 3.1 KB
/
qgsattributetypeloaddialog.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
/***************************************************************************
qgsattributetypeloaddialog.h
-------------------
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 QGSATTRIBUTETYPELOADDIALOG_H
#define QGSATTRIBUTETYPELOADDIALOG_H
#include "ui_qgsattributeloadfrommap.h"
#include <vector>
#include "qgis_gui.h"
class QDialog;
class QLayout;
class QgsField;
class QgsMapCanvas;
class QgsVectorLayer;
/**
* \ingroup gui
* \class QgsAttributeTypeLoadDialog
*/
class GUI_EXPORT QgsAttributeTypeLoadDialog: public QDialog, private Ui::QgsAttributeLoadValues
{
Q_OBJECT
public:
QgsAttributeTypeLoadDialog( QgsVectorLayer *vl );
/**
* Overloaded accept method which will write the feature field
* values, then delegate to QDialog::accept()
*/
void accept() override;
/**
* Sets predefined vector layer for selection of data
* \param layer Vector layer which is to be set as predefined one
*/
void setVectorLayer( QgsVectorLayer *layer );
/**
* Returns the value map which is currently active.
*
* \returns value map of vlues selected from layer
*/
QMap<QString, QVariant> &valueMap();
/**
* Returns true if the "Add NULL value" checkbox has been checked.
*
* \returns true if the "Add NULL value" checkbox has been checked.
*/
bool insertNull();
private slots:
/**
* Slot which reacts to change of selected layer to fill other two comboboxes with correct data
* \param layerIndex index of layer which was selected
*/
void fillComboBoxes( int layerIndex );
/**
* Slot to react to button push or change of selected column for display of preview
* \param fieldIndex indexOfChangedField
* \param full flag if all values should be displayed or just preview of first 10
*/
void createPreview( int fieldIndex, bool full = false );
/**
* Slot to react to value Preview button pushed
*/
void previewButtonPushed();
private:
/**
* Internal function to fill the list of layers
*/
void fillLayerList();
/**
* Function to transfer data from layer to value map used in editing
*/
void loadDataToValueMap();
QgsVectorLayer *mLayer = nullptr;
QMap<QString, QVariant> mValueMap;
};
#endif