18 #ifndef QGSVECTORLAYEREXPORTER_H 19 #define QGSVECTORLAYEREXPORTER_H 21 #include "qgis_core.h" 29 class QProgressDialog;
83 const QString &providerKey,
85 bool onlySelected =
false,
86 QString *errorMessage
SIP_OUT =
nullptr,
87 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
103 const QString &provider,
107 bool overwrite =
false,
108 const QMap<QString, QVariant> &options = QMap<QString, QVariant>() );
127 QString errorMessage()
const;
149 bool createSpatialIndex();
153 QString mErrorMessage;
160 QMap<int, int> mOldToNewAttrIdx;
196 const QString &providerKey,
198 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
199 bool ownsLayer =
false );
209 const QString &providerKey,
211 const QMap<QString, QVariant> &options = QMap<QString, QVariant>() )
SIP_FACTORY;
220 void exportComplete();
226 void errorOccurred(
int error,
const QString &errorMessage );
231 void finished(
bool result )
override;
235 QPointer< QgsVectorLayer > mLayer =
nullptr;
236 bool mOwnsLayer =
false;
239 QString mDestProviderKey;
241 QMap<QString, QVariant> mOptions;
243 std::unique_ptr< QgsFeedback > mOwnedFeedback;
246 QString mErrorMessage;
250 #endif // QGSVECTORLAYEREXPORTER_H Source layer has an attribute type which could not be handled by destination.
Could not access newly created destination layer.
QList< QgsFeature > QgsFeatureList
An interface for objects which accept features via addFeature(s) methods.
Container of fields for a vector layer.
User canceled the export.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Could not find a matching provider key.
Base class for feedback objects to be used for cancelation of something running in a worker thread...
Type
The WKB type describes the number of dimensions a geometry has.
Could not connect to destination.
Destination provider was unable to create an attribute.
Abstract base class for long running background tasks.
Could not create the destination data source.
An error occurred while writing a feature to the destination.
virtual bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=nullptr)
Adds a single feature to the sink.
QgsTask task which performs a QgsVectorLayerExporter layer export operation as a background task...
An error occurred while reprojecting features to destination CRS.
A convenience class for exporting vector layers to a destination data provider.
virtual bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=nullptr)=0
Adds a list of features to the sink.
virtual bool flushBuffer()
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to...
virtual void cancel()
Notifies the task that it should terminate.
int errorCount() const
Returns the number of error messages encountered during the export.
This class represents a coordinate reference system (CRS).
virtual void finished(bool result)
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
virtual bool run()=0
Performs the task's operation.
No errors were encountered.
Could not create destination layer.
This is the base class for vector data providers.
Represents a vector layer which manages a vector based data sets.
Provider does not support creation of empty layers.