16#ifndef QGSPROCESSINGBATCHALGORITHMDIALOGBASE_H
17#define QGSPROCESSINGBATCHALGORITHMDIALOGBASE_H
23#include <QElapsedTimer>
37class GUI_EXPORT QgsProcessingBatchAlgorithmDialogBase :
public QgsProcessingAlgorithmDialogBase
46 QgsProcessingBatchAlgorithmDialogBase( QWidget *parent
SIP_TRANSFERTHIS =
nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
47 ~QgsProcessingBatchAlgorithmDialogBase()
override;
49 void resetAdditionalGui()
override;
50 void blockAdditionalControlsWhileRunning()
override;
57 virtual void runAsSingle() = 0;
61 void algExecuted(
bool successful,
const QVariantMap &results )
override;
64 bool isFinalized()
override;
70 void execute(
const QList<QVariantMap> ¶meters );
77 virtual QgsProcessingContext *createContext( QgsProcessingFeedback *feedback ) = 0
SIP_FACTORY;
82 virtual void handleAlgorithmResults( QgsProcessingAlgorithm *
algorithm, QgsProcessingContext &context, QgsProcessingFeedback *feedback,
const QVariantMap ¶meters ) = 0;
87 virtual void loadHtmlResults(
const QVariantMap &results,
int index ) = 0;
92 virtual void createSummaryTable(
const QList<QVariantMap> &results,
const QList<QVariantMap> &errors ) = 0;
96 void onTaskComplete(
bool ok,
const QVariantMap &results );
97 void taskTriggered( QgsTask *task );
101 void allTasksComplete(
bool canceled );
103 QPushButton *mButtonRunSingle =
nullptr;
105 int mCurrentStep = 0;
107 QList<QVariantMap> mQueuedParameters;
108 QVariantMap mCurrentParameters;
109 QPointer<QgsProxyProgressTask> mProxyTask;
110 std::unique_ptr<QgsProcessingFeedback> mFeedback;
111 std::unique_ptr<QgsProcessingBatchFeedback> mBatchFeedback;
112 std::unique_ptr<QgsProcessingContext> mTaskContext;
113 QList<QVariantMap> mResults;
114 QList<QVariantMap> mErrors;
115 QElapsedTimer mTotalTimer;
116 QElapsedTimer mCurrentStepTimer;
Processing feedback subclass for use when batch processing.
A QgsTask shell which proxies progress reports.
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