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 void updateButtons();
135 void selectRow(
int row );
140 void showEvent( QShowEvent *event )
override;
148class QgsNewVectorTableDialogFieldsDelegate:
public QStyledItemDelegate
153 QgsNewVectorTableDialogFieldsDelegate(
const QList< QgsVectorDataProvider::NativeType> &typeList, QObject *parent =
nullptr );
156 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
157 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
158 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
162 void onFieldTypeChanged(
int index );
166 const QList< QgsVectorDataProvider::NativeType> mTypeList;
187 QgsNewVectorTableFieldModel(
const QList< QgsVectorDataProvider::NativeType> &nativeTypes, QObject *parent =
nullptr );
190 int columnCount(
const QModelIndex & )
const override;
191 QVariant
data(
const QModelIndex &index,
int role )
const override;
192 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
193 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
194 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
196 QList<QgsVectorDataProvider::NativeType> nativeTypes()
const;
202 const QList< QgsVectorDataProvider::NativeType> mNativeTypes;
203 QString typeDesc(
const QString &
typeName )
const;
204 QVariant::Type type(
const QString &
typeName )
const;
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 ...
Type
The WKB type describes the number of dimensions a geometry has.
const QgsCoordinateReferenceSystem & crs