16#ifndef QGSNEWVECTORTABLEDIALOG_H
17#define QGSNEWVECTORTABLEDIALOG_H
19#include <QStyledItemDelegate>
29#include "ui_qgsnewvectortabledialogbase.h"
31class QgsNewVectorTableFieldModel;
61 void setSchemaName(
const QString &name );
66 void setTableName(
const QString &name );
86 QString tableName()
const;
91 QString schemaName()
const;
96 QString geometryColumnName()
const;
111 void setFields(
const QgsFields &fields );
116 bool createSpatialIndex();
121 QStringList validationErrors()
const;
125 QgsNewVectorTableFieldModel *mFieldModel =
nullptr;
126 int mCurrentRow = -1;
128 QStringList mTableNames;
129 QStringList mValidationErrors;
131 QSet<QString> mIllegalFieldNames;
133 void updateButtons();
134 void selectRow(
int row );
139 void showEvent( QShowEvent *event )
override;
146class QgsNewVectorTableDialogFieldsDelegate :
public QStyledItemDelegate
150 QgsNewVectorTableDialogFieldsDelegate(
const QList<QgsVectorDataProvider::NativeType> &typeList, QObject *parent =
nullptr );
153 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
154 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
155 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
159 void onFieldTypeChanged(
int index );
162 const QList<QgsVectorDataProvider::NativeType> mTypeList;
181 QgsNewVectorTableFieldModel(
const QList<QgsVectorDataProvider::NativeType> &nativeTypes, QObject *parent =
nullptr );
184 int columnCount(
const QModelIndex & )
const override;
185 QVariant
data(
const QModelIndex &index,
int role )
const override;
186 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
187 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
188 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
190 QList<QgsVectorDataProvider::NativeType> nativeTypes()
const;
195 const QList<QgsVectorDataProvider::NativeType> mNativeTypes;
196 QString typeDesc(
const QString &
typeName )
const;
197 QMetaType::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