QGIS API Documentation  2.99.0-Master (69af2f5)
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
6  email : [email protected]
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 #include "qgsguiutils.h"
22 #include "qgshelp.h"
23 
24 #include "qgis.h"
25 #include "qgis_gui.h"
26 
30 class GUI_EXPORT QgsNewVectorLayerDialog: public QDialog, private Ui::QgsNewVectorLayerDialogBase
31 {
32  Q_OBJECT
33 
34  public:
35 
40  static QString runAndCreateLayer( QWidget *parent = nullptr, QString *enc = nullptr, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
41 
42  QgsNewVectorLayerDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
45  QgsWkbTypes::Type selectedType() const;
47  void attributes( QList< QPair<QString, QString> > &at ) const;
49  QString selectedFileFormat() const;
51  QString selectedFileEncoding() const;
52 
57  QgsCoordinateReferenceSystem crs() const;
58 
64  void setCrs( const QgsCoordinateReferenceSystem &crs );
65 
66  protected slots:
67  void on_mAddAttributeButton_clicked();
68  void on_mRemoveAttributeButton_clicked();
69  void on_mFileFormatComboBox_currentIndexChanged( int index );
70  void on_mTypeBox_currentIndexChanged( int index );
71  void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/editing_geometry_attributes.html#creating-a-new-shapefile-layer" ) ); }
72  void nameChanged( const QString & );
73  void selectionChanged();
74 
75  private:
76  QPushButton *mOkButton = nullptr;
77 };
78 
79 #endif //qgsnewvectorlayerdialog_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:34
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:66
This class represents a coordinate reference system (CRS).
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Definition: qgshelp.cpp:34