Class: QgsNewVectorTableDialog

The QgsNewVectorTableDialog class is a provider-agnostic database vector and aspatial table designer dialog based on the connections API.

It allows designing a new vector or aspatial database table by defining the schema (if supported by the provider) and table name, the list of QgsFields, the optional geometry type and SRID.

The actual creation of the table is delegated to the connections API method QgsAbstractDatabaseProviderConnection.createVectorTable()

Added in version 3.16.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsNewVectorTableDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

Methods

createSpatialIndex

Returns True if spatialindex checkbox is checked.

crs

Returns the CRS

fields

Returns the fields

geometryColumnName

Returns the geometry column name

geometryType

Returns the geometry type

schemaName

Returns the schema name

setCrs

Sets the CRS to crs

setFields

Sets the fields to fields

setGeometryType

Sets the geometry type

setSchemaName

Sets the schema name

setTableName

Sets the table name

tableName

Returns the table name

validationErrors

Returns the validation errors or an empty list if the dialog is valid

class qgis.gui.QgsNewVectorTableDialog[source]

Bases: QDialog

__init__(conn: QgsAbstractDatabaseProviderConnection | None, parent: QWidget | None = None)

QgsNewVectorTableDialog constructor

Parameters:
createSpatialIndex(self) bool[source]

Returns True if spatialindex checkbox is checked.

Return type:

bool

crs(self) QgsCoordinateReferenceSystem[source]

Returns the CRS

Return type:

QgsCoordinateReferenceSystem

fields(self) QgsFields[source]

Returns the fields

Return type:

QgsFields

geometryColumnName(self) str[source]

Returns the geometry column name

Return type:

str

geometryType(self) Qgis.WkbType[source]

Returns the geometry type

Return type:

Qgis.WkbType

schemaName(self) str[source]

Returns the schema name

Return type:

str

setCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Sets the CRS to crs

Parameters:

crs (QgsCoordinateReferenceSystem)

setFields(self, fields: QgsFields)[source]

Sets the fields to fields

Parameters:

fields (QgsFields)

setGeometryType(self, type: Qgis.WkbType)[source]

Sets the geometry type

Parameters:

type (Qgis.WkbType)

setSchemaName(self, name: str | None)[source]

Sets the schema name

Parameters:

name (Optional[str])

setTableName(self, name: str | None)[source]

Sets the table name

Parameters:

name (Optional[str])

tableName(self) str[source]

Returns the table name

Return type:

str

validationErrors(self) List[str][source]

Returns the validation errors or an empty list if the dialog is valid

Return type:

List[str]