16#ifndef QGSNEWVECTORTABLEDIALOG_H
17#define QGSNEWVECTORTABLEDIALOG_H
19#include <QStyledItemDelegate>
29#include "ui_qgsnewvectortabledialogbase.h"
31class QgsNewVectorTableFieldModel;
62 void setSchemaName(
const QString &name );
67 void setTableName(
const QString &name );
87 QString tableName()
const;
92 QString schemaName()
const;
97 QString geometryColumnName()
const;
112 void setFields(
const QgsFields &fields );
118 bool createSpatialIndex();
123 QStringList validationErrors()
const;
128 QgsNewVectorTableFieldModel *mFieldModel =
nullptr;
129 int mCurrentRow = -1;
131 QStringList mTableNames;
132 QStringList mValidationErrors;
134 QSet<QString> mIllegalFieldNames;
136 void updateButtons();
137 void selectRow(
int row );
142 void showEvent( QShowEvent *event )
override;
150class QgsNewVectorTableDialogFieldsDelegate:
public QStyledItemDelegate
155 QgsNewVectorTableDialogFieldsDelegate(
const QList< QgsVectorDataProvider::NativeType> &typeList, QObject *parent =
nullptr );
158 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
159 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
160 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
164 void onFieldTypeChanged(
int index );
168 const QList< QgsVectorDataProvider::NativeType> mTypeList;
189 QgsNewVectorTableFieldModel(
const QList< QgsVectorDataProvider::NativeType> &nativeTypes, QObject *parent =
nullptr );
192 int columnCount(
const QModelIndex & )
const override;
193 QVariant
data(
const QModelIndex &index,
int role )
const override;
194 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
195 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
196 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
198 QList<QgsVectorDataProvider::NativeType> nativeTypes()
const;
204 const QList< QgsVectorDataProvider::NativeType> mNativeTypes;
205 QString typeDesc(
const QString &
typeName )
const;
206 QVariant::Type type(
const QString &
typeName )
const;
WkbType
The WKB type describes the number of dimensions a geometry has.
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
This class represents a coordinate reference system (CRS).
The QgsFieldModel class is a model to display the list of fields in widgets (optionally associated wi...
int columnCount(const QModelIndex &parent) const override
QVariant data(const QModelIndex &index, int role) const override
Container of fields for a vector layer.
The QgsNewVectorTableDialog class is a provider-agnostic database vector and aspatial table designer ...
const QgsCoordinateReferenceSystem & crs