16#ifndef QGSPROCESSINGBATCHALGORITHMDIALOGBASE_H
17#define QGSPROCESSINGBATCHALGORITHMDIALOGBASE_H
23#include <QElapsedTimer>
37class GUI_EXPORT QgsProcessingBatchAlgorithmDialogBase :
public QgsProcessingAlgorithmDialogBase
45 QgsProcessingBatchAlgorithmDialogBase( QWidget *parent
SIP_TRANSFERTHIS =
nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
46 ~QgsProcessingBatchAlgorithmDialogBase()
override;
48 void resetAdditionalGui()
override;
49 void blockAdditionalControlsWhileRunning()
override;
56 virtual void runAsSingle() = 0;
60 void algExecuted(
bool successful,
const QVariantMap &results )
override;
63 bool isFinalized()
override;
69 void execute(
const QList<QVariantMap> ¶meters );
86 virtual void loadHtmlResults(
const QVariantMap &results,
int index ) = 0;
91 virtual void createSummaryTable(
const QList<QVariantMap> &results,
const QList<QVariantMap> &errors ) = 0;
95 void onTaskComplete(
bool ok,
const QVariantMap &results );
96 void taskTriggered(
QgsTask *task );
100 void allTasksComplete(
bool canceled );
102 QPushButton *mButtonRunSingle =
nullptr;
104 int mCurrentStep = 0;
106 QList<QVariantMap> mQueuedParameters;
107 QVariantMap mCurrentParameters;
108 QPointer<QgsProxyProgressTask> mProxyTask;
109 std::unique_ptr<QgsProcessingFeedback> mFeedback;
110 std::unique_ptr<QgsProcessingBatchFeedback> mBatchFeedback;
111 std::unique_ptr<QgsProcessingContext> mTaskContext;
112 QList<QVariantMap> mResults;
113 QList<QVariantMap> mErrors;
114 QElapsedTimer mTotalTimer;
115 QElapsedTimer mCurrentStepTimer;
Abstract base class for processing algorithms.
Processing feedback subclass for use when batch processing.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
A QgsTask shell which proxies progress reports.
Abstract base class for long running background tasks.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call