QGIS API Documentation 3.43.0-Master (9e873c7bc91)
Loading...
Searching...
No Matches
qgsdbimportvectorlayerdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdbimportvectorlayerdialog.h
3 --------------------------------------
4 Date : March 2025
5 Copyright : (C) 2025 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSDBIMPORTVECTORLAYERDIALOG_H
17#define QGSDBIMPORTVECTORLAYERDIALOG_H
18
19#include "qgis_gui.h"
20#include "qgis.h"
21#include "qgsmimedatautils.h"
23#include "ui_qgsdbimportvectorlayerdialog.h"
24
27
28#define SIP_NO_FILE
29
40class GUI_EXPORT QgsDbImportVectorLayerDialog : public QDialog, private Ui::QgsDbImportVectorLayerDialog, public QgsExpressionContextGenerator
41{
42 Q_OBJECT
43
44 public:
52
56 void setDestinationSchema( const QString &schema );
57
61 void setSourceUri( const QgsMimeDataUtils::Uri &uri );
62
66 QString schema() const;
67
71 QString tableName() const;
72
76 QString tableComment() const;
77
81 void setMapCanvas( QgsMapCanvas *canvas );
82
86 std::unique_ptr<QgsVectorLayerExporterTask> createExporterTask( const QVariantMap &extraProviderOptions = QVariantMap() );
87
89
90 private slots:
91 void sourceLayerComboChanged();
92 void doImport();
93 void setSourceLayer( QgsVectorLayer *layer );
94 void loadFieldsFromLayer();
95 void addField();
96
97 private:
98 std::unique_ptr< QgsVectorLayer > mOwnedSource;
99 QPointer< QgsVectorLayer > mSourceLayer;
100
101 int mBlockSourceLayerChanges = 0;
102
103 std::unique_ptr< QgsAbstractDatabaseProviderConnection > mConnection;
104};
105
106#endif // QGSDBIMPORTVECTORLAYERDIALOG_H
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
A generic dialog for customising vector layer import options for database connections.
~QgsDbImportVectorLayerDialog() override
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Map canvas is a class for displaying all GIS data types on a canvas.
QgsTask task which performs a QgsVectorLayerExporter layer export operation as a background task.
Represents a vector layer which manages a vector based data sets.
#define SIP_TRANSFER
Definition qgis_sip.h:36