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 );
117 bool createSpatialIndex();
122 QStringList validationErrors()
const;
127 QgsNewVectorTableFieldModel *mFieldModel =
nullptr;
128 int mCurrentRow = -1;
130 QStringList mTableNames;
131 QStringList mValidationErrors;
133 QSet<QString> mIllegalFieldNames;
135 void updateButtons();
136 void selectRow(
int row );
141 void showEvent( QShowEvent *event )
override;
149class QgsNewVectorTableDialogFieldsDelegate:
public QStyledItemDelegate
154 QgsNewVectorTableDialogFieldsDelegate(
const QList< QgsVectorDataProvider::NativeType> &typeList, QObject *parent =
nullptr );
157 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
158 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
159 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
163 void onFieldTypeChanged(
int index );
167 const QList< QgsVectorDataProvider::NativeType> mTypeList;
188 QgsNewVectorTableFieldModel(
const QList< QgsVectorDataProvider::NativeType> &nativeTypes, QObject *parent =
nullptr );
191 int columnCount(
const QModelIndex & )
const override;
192 QVariant
data(
const QModelIndex &index,
int role )
const override;
193 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
194 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
195 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
197 QList<QgsVectorDataProvider::NativeType> nativeTypes()
const;
203 const QList< QgsVectorDataProvider::NativeType> mNativeTypes;
204 QString typeDesc(
const QString &
typeName )
const;
205 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