QGIS API Documentation  3.17.0-Master (8af46bc54f)
Public Member Functions | Protected Member Functions | List of all members
QgsNewVectorTableDialog Class Reference

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

#include <qgsnewvectortabledialog.h>

Inheritance diagram for QgsNewVectorTableDialog:
Inheritance graph
[legend]

Public Member Functions

 QgsNewVectorTableDialog (QgsAbstractDatabaseProviderConnection *conn, QWidget *parent=nullptr)
 QgsNewVectorTableDialog constructor. More...
 
bool createSpatialIndex ()
 Returns true if spatialindex checkbox is cheched. More...
 
QgsCoordinateReferenceSystem crs () const
 Returns the CRS. More...
 
QgsFields fields () const
 Returns the fields. More...
 
QString geometryColumnName () const
 Returns the geometry column name. More...
 
QgsWkbTypes::Type geometryType () const
 Returns the geometry type. More...
 
QString schemaName () const
 Returns the schema name. More...
 
void setCrs (const QgsCoordinateReferenceSystem &crs)
 Sets the CRS to crs. More...
 
void setFields (const QgsFields &fields)
 Sets the fields to fields. More...
 
void setGeometryType (QgsWkbTypes::Type type)
 Sets the geometry type. More...
 
void setSchemaName (const QString &name)
 Sets the schema name. More...
 
void setTableName (const QString &name)
 Sets the table name. More...
 
QString tableName () const
 Returns the table name. More...
 
QStringList validationErrors () const
 Returns the validation errors or an empty list if the dialog is valid. More...
 

Protected Member Functions

void showEvent (QShowEvent *event) override
 

Detailed Description

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()

Since
QGIS 3.16

Definition at line 47 of file qgsnewvectortabledialog.h.

Constructor & Destructor Documentation

◆ QgsNewVectorTableDialog()

QgsNewVectorTableDialog::QgsNewVectorTableDialog ( QgsAbstractDatabaseProviderConnection conn,
QWidget *  parent = nullptr 
)

QgsNewVectorTableDialog constructor.

Parameters
connDB connection, ownership is NOT transferred
parentoptional parent

Definition at line 25 of file qgsnewvectortabledialog.cpp.

Member Function Documentation

◆ createSpatialIndex()

bool QgsNewVectorTableDialog::createSpatialIndex ( )

Returns true if spatialindex checkbox is cheched.

Returns

Definition at line 337 of file qgsnewvectortabledialog.cpp.

◆ crs()

QgsCoordinateReferenceSystem QgsNewVectorTableDialog::crs ( ) const

Returns the CRS.

Definition at line 289 of file qgsnewvectortabledialog.cpp.

◆ fields()

QgsFields QgsNewVectorTableDialog::fields ( ) const

Returns the fields.

Definition at line 309 of file qgsnewvectortabledialog.cpp.

◆ geometryColumnName()

QString QgsNewVectorTableDialog::geometryColumnName ( ) const

Returns the geometry column name.

Definition at line 304 of file qgsnewvectortabledialog.cpp.

◆ geometryType()

QgsWkbTypes::Type QgsNewVectorTableDialog::geometryType ( ) const

Returns the geometry type.

Definition at line 314 of file qgsnewvectortabledialog.cpp.

◆ schemaName()

QString QgsNewVectorTableDialog::schemaName ( ) const

Returns the schema name.

Definition at line 299 of file qgsnewvectortabledialog.cpp.

◆ setCrs()

void QgsNewVectorTableDialog::setCrs ( const QgsCoordinateReferenceSystem crs)

Sets the CRS to crs.

Definition at line 284 of file qgsnewvectortabledialog.cpp.

◆ setFields()

void QgsNewVectorTableDialog::setFields ( const QgsFields fields)

Sets the fields to fields.

Definition at line 329 of file qgsnewvectortabledialog.cpp.

◆ setGeometryType()

void QgsNewVectorTableDialog::setGeometryType ( QgsWkbTypes::Type  type)

Sets the geometry type.

Definition at line 279 of file qgsnewvectortabledialog.cpp.

◆ setSchemaName()

void QgsNewVectorTableDialog::setSchemaName ( const QString &  name)

Sets the schema name.

Definition at line 269 of file qgsnewvectortabledialog.cpp.

◆ setTableName()

void QgsNewVectorTableDialog::setTableName ( const QString &  name)

Sets the table name.

Definition at line 274 of file qgsnewvectortabledialog.cpp.

◆ showEvent()

void QgsNewVectorTableDialog::showEvent ( QShowEvent *  event)
overrideprotected

Definition at line 402 of file qgsnewvectortabledialog.cpp.

◆ tableName()

QString QgsNewVectorTableDialog::tableName ( ) const

Returns the table name.

Definition at line 294 of file qgsnewvectortabledialog.cpp.

◆ validationErrors()

QStringList QgsNewVectorTableDialog::validationErrors ( ) const

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

Definition at line 342 of file qgsnewvectortabledialog.cpp.


The documentation for this class was generated from the following files: