QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
vector
qgssourcefieldsproperties.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgssourcefieldsproperties.h
3
---------------------
4
begin : July 2017
5
copyright : (C) 2017 by David Signer
6
email : david at opengis dot ch
7
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
17
#ifndef QGSSOURCEFIELDSPROPERTIES_H
18
#define QGSSOURCEFIELDSPROPERTIES_H
19
20
// We don't want to expose this in the public API
21
22
#include "ui_qgssourcefieldsproperties.h"
23
24
#include "qgis_gui.h"
25
#include "
qgsexpressionbuilderdialog.h
"
26
#include "
qgsfieldcalculator.h
"
27
#include "
qgslogger.h
"
28
29
#include <QDropEvent>
30
#include <QFileDialog>
31
#include <QFormLayout>
32
#include <QHBoxLayout>
33
#include <QMessageBox>
34
#include <QMimeData>
35
#include <QPushButton>
36
#include <QSpinBox>
37
#include <QTableWidget>
38
#include <QTableWidgetItem>
39
#include <QTreeWidget>
40
#include <QTreeWidgetItem>
41
#include <QWidget>
42
43
#define SIP_NO_FILE
44
51
class
GUI_EXPORT
QgsSourceFieldsProperties
:
public
QWidget,
private
Ui_QgsSourceFieldsProperties
52
{
53
Q_OBJECT
54
55
public
:
56
explicit
QgsSourceFieldsProperties
(
QgsVectorLayer
*layer, QWidget *parent =
nullptr
);
57
58
void
init
();
59
void
apply
();
60
61
void
loadRows
();
62
void
setRow
(
int
row,
int
idx,
const
QgsField
&field );
63
69
bool
addAttribute
(
const
QgsField
&field );
70
71
protected
:
72
void
updateButtons
();
73
74
QgsVectorLayer
*
mLayer
=
nullptr
;
75
76
// Holds all the first column items (header: id) of the table.
77
// The index in the list is the fieldIdx, and therefore acts as a mapping
78
// between fieldIdx and QTableWidgetItem->row()
79
QList<QTableWidgetItem *>
mIndexedWidgets
;
80
81
enum
AttrColumns
82
{
83
AttrIdCol
= 0,
84
AttrNameCol
,
85
AttrAliasCol
,
86
AttrTypeCol
,
87
AttrTypeNameCol
,
88
AttrLengthCol
,
89
AttrPrecCol
,
90
AttrFieldDomainCol
,
91
AttrCommentCol
,
92
AttrConfigurationFlagsCol
,
93
AttrColCount
,
94
};
95
96
private
:
97
void
updateFieldRenamingStatus();
98
99
signals:
100
void
toggleEditing
();
101
102
private
slots:
103
104
void
updateExpression();
105
107
void
editingToggled();
108
void
addAttributeClicked();
109
void
deleteAttributeClicked();
110
void
calculateFieldClicked();
111
void
saveLayerEditsClicked();
112
113
void
attributeAdded(
int
idx );
114
void
attributeDeleted(
int
idx );
115
116
void
attributesListCellChanged(
int
row,
int
column );
117
void
attributesListCellPressed(
int
row,
int
column );
118
119
void
applyToLayer(
QgsVectorLayer
*layer );
120
121
friend
class
QgsAttributesFormProperties
;
122
};
123
124
#endif
// QGSSOURCEFIELDSPROPERTIES_H
QgsField
Encapsulate a field in an attribute table or data source.
Definition
qgsfield.h:56
QgsSourceFieldsProperties::toggleEditing
void toggleEditing()
QgsSourceFieldsProperties::AttrColumns
AttrColumns
Definition
qgssourcefieldsproperties.h:82
QgsSourceFieldsProperties::AttrPrecCol
@ AttrPrecCol
Definition
qgssourcefieldsproperties.h:89
QgsSourceFieldsProperties::AttrTypeNameCol
@ AttrTypeNameCol
Definition
qgssourcefieldsproperties.h:87
QgsSourceFieldsProperties::AttrIdCol
@ AttrIdCol
Definition
qgssourcefieldsproperties.h:83
QgsSourceFieldsProperties::AttrNameCol
@ AttrNameCol
Definition
qgssourcefieldsproperties.h:84
QgsSourceFieldsProperties::AttrCommentCol
@ AttrCommentCol
Definition
qgssourcefieldsproperties.h:91
QgsSourceFieldsProperties::AttrLengthCol
@ AttrLengthCol
Definition
qgssourcefieldsproperties.h:88
QgsSourceFieldsProperties::AttrTypeCol
@ AttrTypeCol
Definition
qgssourcefieldsproperties.h:86
QgsSourceFieldsProperties::AttrColCount
@ AttrColCount
Definition
qgssourcefieldsproperties.h:93
QgsSourceFieldsProperties::AttrFieldDomainCol
@ AttrFieldDomainCol
Definition
qgssourcefieldsproperties.h:90
QgsSourceFieldsProperties::AttrAliasCol
@ AttrAliasCol
Definition
qgssourcefieldsproperties.h:85
QgsSourceFieldsProperties::AttrConfigurationFlagsCol
@ AttrConfigurationFlagsCol
Definition
qgssourcefieldsproperties.h:92
QgsSourceFieldsProperties::mIndexedWidgets
QList< QTableWidgetItem * > mIndexedWidgets
Definition
qgssourcefieldsproperties.h:79
QgsSourceFieldsProperties::QgsAttributesFormProperties
friend class QgsAttributesFormProperties
Definition
qgssourcefieldsproperties.h:121
QgsSourceFieldsProperties::QgsSourceFieldsProperties
QgsSourceFieldsProperties(QgsVectorLayer *layer, QWidget *parent=nullptr)
Definition
qgssourcefieldsproperties.cpp:37
QgsSourceFieldsProperties::updateButtons
void updateButtons()
Definition
qgssourcefieldsproperties.cpp:437
QgsSourceFieldsProperties::init
void init()
Definition
qgssourcefieldsproperties.cpp:97
QgsSourceFieldsProperties::addAttribute
bool addAttribute(const QgsField &field)
Adds an attribute to the table (but does not commit it yet).
Definition
qgssourcefieldsproperties.cpp:287
QgsSourceFieldsProperties::apply
void apply()
Definition
qgssourcefieldsproperties.cpp:304
QgsSourceFieldsProperties::mLayer
QgsVectorLayer * mLayer
Definition
qgssourcefieldsproperties.h:74
QgsSourceFieldsProperties::loadRows
void loadRows()
Definition
qgssourcefieldsproperties.cpp:102
QgsSourceFieldsProperties::setRow
void setRow(int row, int idx, const QgsField &field)
Definition
qgssourcefieldsproperties.cpp:221
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgsexpressionbuilderdialog.h
qgsfieldcalculator.h
qgslogger.h
Generated on
for QGIS API Documentation by
1.17.0