QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsaddattrdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsaddattrdialog.h - description
3 -------------------
4 begin : January 2005
5 copyright : (C) 2005 by Marco Hugentobler
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSADDATTRDIALOG_H
19#define QGSADDATTRDIALOG_H
20
21// We don't want to expose this in the public API
22#define SIP_NO_FILE
23
24#include "ui_qgsaddattrdialogbase.h"
25
26#include "qgis_gui.h"
27#include "qgsguiutils.h"
28
29#include <QSet>
30
31class QgsVectorLayer;
32class QgsField;
33
41class GUI_EXPORT QgsAddAttrDialog : public QDialog, private Ui::QgsAddAttrDialogBase
42{
43 Q_OBJECT
44 public:
46 QgsAddAttrDialog( QgsVectorLayer *vlayer, QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
48 QgsAddAttrDialog( const std::list<QString> &typelist, QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
49
56 void setIllegalFieldNames( const QSet<QString> &names );
57
59 QgsField field() const;
60
61 private slots:
62 void mTypeBox_currentIndexChanged( int idx );
63 void mLength_editingFinished();
64 void accept() override;
65
66 private:
67 bool mIsShapeFile = false;
68 QSet<QString> mIllegalFieldNames;
69
70 void setPrecisionMinMax();
71};
72
73#endif
QgsField field() const
Returns a field for the configured attribute.
void setIllegalFieldNames(const QSet< QString > &names)
Sets a list of field names which are considered illegal and should not be accepted by the dialog.
QgsAddAttrDialog(const std::list< QString > &typelist, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
constructor
QgsAddAttrDialog(QgsVectorLayer *vlayer, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
constructor
Encapsulate a field in an attribute table or data source.
Definition qgsfield.h:54
Represents a vector layer which manages a vector based dataset.