QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsnewvectorlayerdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsnewvectorlayerdialog.h - description
3 -------------------
4 begin : October 2004
5 copyright : (C) 2004 by Marco Hugentobler
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef qgsnewvectorlayerdialog_H
18#define qgsnewvectorlayerdialog_H
19
20#include "ui_qgsnewvectorlayerdialogbase.h"
21
22#include "qgis_gui.h"
23#include "qgis_sip.h"
24#include "qgsguiutils.h"
25#include "qgshelp.h"
26#include "qgswkbtypes.h"
27
33class GUI_EXPORT QgsNewVectorLayerDialog : public QDialog, private Ui::QgsNewVectorLayerDialogBase
34{
35 Q_OBJECT
36
37 public:
47 Q_DECL_DEPRECATED static QString runAndCreateLayer( QWidget *parent = nullptr, QString *enc = nullptr, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(), const QString &initialPath = QString() ) SIP_DEPRECATED;
48
70 static QString execAndCreateLayer( QString &errorMessage SIP_OUT, QWidget *parent = nullptr, const QString &initialPath = QString(), QString *encoding SIP_OUT = nullptr, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
71
75 QgsNewVectorLayerDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
79 void attributes( QList<QPair<QString, QString>> &at ) const;
81 QString selectedFileFormat() const;
83 QString selectedFileEncoding() const;
84
90 QString filename() const;
91
99 void setFilename( const QString &filename );
100
106
112
113 public slots:
114 void accept() override;
115
116 private slots:
117 void mAddAttributeButton_clicked();
118 void mRemoveAttributeButton_clicked();
119 void mFileFormatComboBox_currentIndexChanged( int index );
120 void mTypeBox_currentIndexChanged( int index );
121 void checkOk();
122
124 void showHelp();
125 void nameChanged( const QString & );
126 void selectionChanged();
127 void moveFieldsUp();
128 void moveFieldsDown();
129
130 private:
131 QPushButton *mOkButton = nullptr;
132
133 void updateExtension();
134};
135
136#endif //qgsnewvectorlayerdialog_H
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:277
Represents a coordinate reference system (CRS).
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.
void attributes(QList< QPair< QString, QString > > &at) const
Appends the chosen attribute names and types to at.
QgsCoordinateReferenceSystem crs() const
Returns the selected CRS for the new layer.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the crs value for the new layer in the dialog.
QString filename() const
Returns the name for the new layer.
QString selectedFileFormat() const
Returns the file format for storage.
QString selectedFileEncoding() const
Returns the file format for storage.
QgsNewVectorLayerDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
New dialog constructor.
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.
Qgis::WkbType selectedType() const
Returns the selected geometry type.
void setFilename(const QString &filename)
Sets the initial file name to show in the dialog.
#define SIP_DEPRECATED
Definition qgis_sip.h:114
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_OUT
Definition qgis_sip.h:58