QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Types | Public Member Functions | List of all members
QgsNewGeoPackageLayerDialog Class Reference

Dialog to set up parameters to create a new GeoPackage layer, and on accept() to create it and add it to the layers. More...

#include <qgsnewgeopackagelayerdialog.h>

Inheritance diagram for QgsNewGeoPackageLayerDialog:
Inheritance graph
[legend]

Public Types

enum  OverwriteBehavior { Prompt, Overwrite, AddNewLayer }
 Behavior to use when an existing geopackage already exists. More...
 

Public Member Functions

 QgsNewGeoPackageLayerDialog (QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
 Constructor. More...
 
QString databasePath () const
 Returns the database path. More...
 
void lockDatabasePath ()
 Sets the database path widgets to a locked and read-only mode. More...
 
void setAddToProject (bool addToProject)
 Sets whether a newly created layer should automatically be added to the current project. More...
 
void setCrs (const QgsCoordinateReferenceSystem &crs)
 Sets the crs value for the new layer in the dialog. More...
 
void setDatabasePath (const QString &path)
 Sets the initial database path. More...
 
void setOverwriteBehavior (OverwriteBehavior behavior)
 Sets the behavior to use when a path to an existing geopackage file is used. More...
 

Detailed Description

Dialog to set up parameters to create a new GeoPackage layer, and on accept() to create it and add it to the layers.

Definition at line 30 of file qgsnewgeopackagelayerdialog.h.

Member Enumeration Documentation

◆ OverwriteBehavior

Behavior to use when an existing geopackage already exists.

Enumerator
Prompt 

Prompt user for action.

Overwrite 

Overwrite whole geopackage.

AddNewLayer 

Keep existing contents and add new layer.

Definition at line 37 of file qgsnewgeopackagelayerdialog.h.

Constructor & Destructor Documentation

◆ QgsNewGeoPackageLayerDialog()

QgsNewGeoPackageLayerDialog::QgsNewGeoPackageLayerDialog ( QWidget *  parent = nullptr,
Qt::WindowFlags  fl = QgsGuiUtils::ModalDialogFlags 
)

Constructor.

Definition at line 50 of file qgsnewgeopackagelayerdialog.cpp.

Member Function Documentation

◆ databasePath()

QString QgsNewGeoPackageLayerDialog::databasePath ( ) const
inline

Returns the database path.

Since
QGIS 3.0

Definition at line 57 of file qgsnewgeopackagelayerdialog.h.

◆ lockDatabasePath()

void QgsNewGeoPackageLayerDialog::lockDatabasePath ( )

Sets the database path widgets to a locked and read-only mode.

Since
QGIS 3.0

Definition at line 153 of file qgsnewgeopackagelayerdialog.cpp.

◆ setAddToProject()

void QgsNewGeoPackageLayerDialog::setAddToProject ( bool  addToProject)

Sets whether a newly created layer should automatically be added to the current project.

Defaults to true.

Since
QGIS 3.6

Definition at line 543 of file qgsnewgeopackagelayerdialog.cpp.

◆ setCrs()

void QgsNewGeoPackageLayerDialog::setCrs ( const QgsCoordinateReferenceSystem crs)

Sets the crs value for the new layer in the dialog.

Since
QGIS 3.0

Definition at line 148 of file qgsnewgeopackagelayerdialog.cpp.

◆ setDatabasePath()

void QgsNewGeoPackageLayerDialog::setDatabasePath ( const QString &  path)
inline

Sets the initial database path.

Since
QGIS 3.0

Definition at line 63 of file qgsnewgeopackagelayerdialog.h.

◆ setOverwriteBehavior()

void QgsNewGeoPackageLayerDialog::setOverwriteBehavior ( OverwriteBehavior  behavior)

Sets the behavior to use when a path to an existing geopackage file is used.

The default behavior is to prompt the user for an action to take.

Since
QGIS 3.0

Definition at line 538 of file qgsnewgeopackagelayerdialog.cpp.


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