QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
#include <qgsnewvectorlayerdialog.h>
Public Slots | |
void | accept () override |
Public Member Functions | |
QgsNewVectorLayerDialog (QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags) | |
New dialog constructor. More... | |
void | attributes (QList< QPair< QString, QString > > &at) const |
Appends the chosen attribute names and types to at. More... | |
QgsCoordinateReferenceSystem | crs () const |
Returns the selected CRS for the new layer. More... | |
QString | filename () const |
Returns the name for the new layer. More... | |
QString | selectedFileEncoding () const |
Returns the file format for storage. More... | |
QString | selectedFileFormat () const |
Returns the file format for storage. More... | |
QgsWkbTypes::Type | selectedType () const |
Returns the selected geometry type. More... | |
void | setCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the crs value for the new layer in the dialog. More... | |
void | setFilename (const QString &filename) |
Sets the initial file name to show in the dialog. More... | |
Static Public Member Functions | |
static QString | execAndCreateLayer (QString &errorMessage, QWidget *parent=nullptr, const QString &initialPath=QString(), QString *encoding=nullptr, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem()) |
Runs the dialog and creates a layer matching the dialog parameters. More... | |
static Q_DECL_DEPRECATED QString | runAndCreateLayer (QWidget *parent=nullptr, QString *enc=nullptr, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem(), const QString &initialPath=QString()) |
Runs the dialog and creates a layer matching the dialog parameters. More... | |
Definition at line 32 of file qgsnewvectorlayerdialog.h.
QgsNewVectorLayerDialog::QgsNewVectorLayerDialog | ( | QWidget * | parent = nullptr , |
Qt::WindowFlags | fl = QgsGuiUtils::ModalDialogFlags |
||
) |
New dialog constructor.
Definition at line 39 of file qgsnewvectorlayerdialog.cpp.
|
overrideslot |
Definition at line 308 of file qgsnewvectorlayerdialog.cpp.
void QgsNewVectorLayerDialog::attributes | ( | QList< QPair< QString, QString > > & | at | ) | const |
Appends the chosen attribute names and types to at.
Definition at line 225 of file qgsnewvectorlayerdialog.cpp.
QgsCoordinateReferenceSystem QgsNewVectorLayerDialog::crs | ( | ) | const |
Returns the selected CRS for the new layer.
Definition at line 197 of file qgsnewvectorlayerdialog.cpp.
|
static |
Runs the dialog and creates a layer matching the dialog parameters.
If the initialPath argument is specified, then the dialog will default to the specified filename.
Returns a filename if the dialog was accepted, or an empty string if the dialog was canceled. If the dialog was accepted but an error occurred while creating the file, then the function will return an empty string and errorMessage will contain the error message.
If encoding is specified, it will be set to the encoding of the created file.
errorMessage | will be set to any error message encountered during layer creation |
parent | parent widget for dialog |
initialPath | initial file path to show in dialog |
encoding | if specified, will be set to file encoding of created layer |
crs | default layer CRS to show in dialog |
Definition at line 319 of file qgsnewvectorlayerdialog.cpp.
QString QgsNewVectorLayerDialog::filename | ( | ) | const |
Returns the name for the new layer.
Definition at line 260 of file qgsnewvectorlayerdialog.cpp.
|
static |
Runs the dialog and creates a layer matching the dialog parameters.
If the initialPath argument is specified, then the dialog will default to the specified filename.
Definition at line 277 of file qgsnewvectorlayerdialog.cpp.
QString QgsNewVectorLayerDialog::selectedFileEncoding | ( | ) | const |
Returns the file format for storage.
Definition at line 245 of file qgsnewvectorlayerdialog.cpp.
QString QgsNewVectorLayerDialog::selectedFileFormat | ( | ) | const |
Returns the file format for storage.
Definition at line 238 of file qgsnewvectorlayerdialog.cpp.
QgsWkbTypes::Type QgsNewVectorLayerDialog::selectedType | ( | ) | const |
Returns the selected geometry type.
Definition at line 182 of file qgsnewvectorlayerdialog.cpp.
void QgsNewVectorLayerDialog::setCrs | ( | const QgsCoordinateReferenceSystem & | crs | ) |
Sets the crs value for the new layer in the dialog.
Definition at line 202 of file qgsnewvectorlayerdialog.cpp.
void QgsNewVectorLayerDialog::setFilename | ( | const QString & | filename | ) |
Sets the initial file name to show in the dialog.
Definition at line 265 of file qgsnewvectorlayerdialog.cpp.