QGIS API Documentation 3.43.0-Master (3ee7834ace6)
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
28
29#define SIP_NO_FILE
30
41class GUI_EXPORT QgsDbImportVectorLayerDialog : public QDialog, private Ui::QgsDbImportVectorLayerDialog, public QgsExpressionContextGenerator
42{
43 Q_OBJECT
44
45 public:
53
57 void setDestinationSchema( const QString &schema );
58
62 void setSourceUri( const QgsMimeDataUtils::Uri &uri );
63
67 QString schema() const;
68
72 QString tableName() const;
73
77 QString tableComment() const;
78
82 void setMapCanvas( QgsMapCanvas *canvas );
83
87 std::unique_ptr<QgsVectorLayerExporterTask> createExporterTask( const QVariantMap &extraProviderOptions = QVariantMap() );
88
90
91 private slots:
92 void sourceLayerComboChanged();
93 void doImport();
94 void setSourceLayer( QgsVectorLayer *layer );
95 void loadFieldsFromLayer();
96 void addField();
97
98 private:
99 QgsDatabaseSchemaComboBox *mSchemaCombo = nullptr;
100
101 std::unique_ptr< QgsVectorLayer > mOwnedSource;
102 QPointer< QgsVectorLayer > mSourceLayer;
103
104 int mBlockSourceLayerChanges = 0;
105
106 std::unique_ptr< QgsAbstractDatabaseProviderConnection > mConnection;
107};
108
109#endif // QGSDBIMPORTVECTORLAYERDIALOG_H
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
The QgsDatabaseSchemaComboBox class is a combo box which displays the list of schemas for a specific ...
A generic dialog for customising vector layer import options for database connections.
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