QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
23 , mDestFileName( fileName )
36 mOptions.
feedback = mOwnedFeedback.get();
44 mError = QgsVectorFileWriter::prepareWriteAsVectorFormat( layer, mOptions, mWriterDetails );
62 mWriterDetails, mDestFileName, mTransformContext, mOptions, &mNewFilename, &mNewLayer, &mErrorMessage );
71 emit
completed( mNewFilename, mNewLayer );
Options to pass to writeAsVectorFormat()
QgsVectorFileWriterTask(QgsVectorLayer *layer, const QString &fileName, const QgsVectorFileWriter::SaveVectorOptions &options)
Constructor for QgsVectorFileWriterTask.
void cancel() override
Notifies the task that it should terminate.
virtual QgsVectorFileWriter::FieldValueConverter * clone() const
Creates a clone of the FieldValueConverter.
void cancel()
Tells the internal routines that the current operation should be canceled. This should be run by the ...
bool run() override
Performs the task's operation.
void errorOccurred(int error, const QString &errorMessage)
Emitted when an error occurs which prevented the file being written (or if the task is canceled).
virtual void cancel()
Notifies the task that it should terminate.
QgsFeedback * feedback
Optional feedback object allowing cancellation of layer save.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
QgsVectorFileWriter::FieldValueConverter * fieldValueConverter
Field value converter.
void completed(const QString &newFilename, const QString &newLayer)
Emitted when writing the layer is successfully completed.
void setProgress(double progress)
Sets the task's current progress.
void progressChanged(double progress)
Emitted when the feedback object reports a progress change.
void writeComplete(const QString &newFilename)
Emitted when writing the layer is successfully completed.
QgsCoordinateTransformContext transformContext() const
Returns the layer data provider coordinate transform context or a default transform context if the la...
Represents a vector layer which manages a vector based data sets.
static Q_DECL_DEPRECATED QgsVectorFileWriter::WriterError writeAsVectorFormatV2(QgsVectorLayer *layer, const QString &fileName, const QgsCoordinateTransformContext &transformContext, const QgsVectorFileWriter::SaveVectorOptions &options, QString *newFilename=nullptr, QString *newLayer=nullptr, QString *errorMessage=nullptr)
Writes a layer out to a vector file.
void finished(bool result) override
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
Abstract base class for long running background tasks. Tasks can be controlled directly,...