QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgsnewgeopackagelayerdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsnewgeopackagelayerdialog.h
3 -------------------
4 begin : April 2016
5 copyright : (C) 2016 by Even Rouault
6 email : even.rouault at spatialys.com
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 QGSNEWGEOPACKAGELAYERDIALOG_H
18#define QGSNEWGEOPACKAGELAYERDIALOG_H
19
20#include "ui_qgsnewgeopackagelayerdialogbase.h"
21#include "qgsguiutils.h"
22
23#include "qgis_sip.h"
24#include "qgis_gui.h"
25
30class GUI_EXPORT QgsNewGeoPackageLayerDialog: public QDialog, private Ui::QgsNewGeoPackageLayerDialogBase
31{
32 Q_OBJECT
33
34 public:
35
43
45 QgsNewGeoPackageLayerDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
46
50 void setCrs( const QgsCoordinateReferenceSystem &crs );
51
55 QString databasePath() const { return mDatabase->filePath(); }
56
60 void setDatabasePath( const QString &path ) { mDatabase->setFilePath( path ); }
61
65 void lockDatabasePath();
66
73 void setOverwriteBehavior( OverwriteBehavior behavior );
74
81 void setAddToProject( bool addToProject );
82
83 private slots:
84 void mAddAttributeButton_clicked();
85 void mRemoveAttributeButton_clicked();
86 void mFieldTypeBox_currentIndexChanged( int index );
87 void mGeometryTypeBox_currentIndexChanged( int index );
88 void mTableNameEdit_textChanged( const QString &text );
89 void mTableNameEdit_textEdited( const QString &text );
90 void mLayerIdentifierEdit_textEdited( const QString &text );
91 void fieldNameChanged( const QString & );
92 void selectionChanged();
93 void checkOk();
94
95 void showHelp();
96 void buttonBox_accepted();
97 void buttonBox_rejected();
98 void moveFieldsUp();
99 void moveFieldsDown();
100
101 private:
102 bool apply();
103
104 QPushButton *mOkButton = nullptr;
105 QString mCrsId;
106 bool mTableNameEdited = false;
107 bool mLayerIdentifierEdited = false;
108 OverwriteBehavior mBehavior = Prompt;
109 bool mAddToProject = true;
110};
111
112#endif // QGSNEWVECTORLAYERDIALOG_H
This class represents a coordinate reference system (CRS).
Dialog to set up parameters to create a new GeoPackage layer, and on accept() to create it and add it...
OverwriteBehavior
Behavior to use when an existing geopackage already exists.
@ AddNewLayer
Keep existing contents and add new layer.
@ Overwrite
Overwrite whole geopackage.
void setDatabasePath(const QString &path)
Sets the initial database path.
QString databasePath() const
Returns the database path.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
const QgsCoordinateReferenceSystem & crs