16 #ifndef QGSPROCESSINGALGORITHMDIALOGBASE_H 17 #define QGSPROCESSINGALGORITHMDIALOGBASE_H 21 #include "ui_qgsprocessingalgorithmdialogbase.h" 22 #include "ui_qgsprocessingalgorithmprogressdialogbase.h" 30 class QgsProcessingAlgorithmDialogBase;
52 QgsProcessingAlgorithmDialogFeedback();
56 void progressTextChanged(
const QString &text );
57 void errorReported(
const QString &text,
bool fatalError );
58 void infoPushed(
const QString &text );
59 void commandInfoPushed(
const QString &text );
60 void debugInfoPushed(
const QString &text );
61 void consoleInfoPushed(
const QString &text );
66 void reportError(
const QString &error,
bool fatalError )
override;
67 void pushInfo(
const QString &info )
override;
82 class GUI_EXPORT QgsProcessingAlgorithmDialogBase :
public QDialog,
private Ui::QgsProcessingDialogBase
91 QgsProcessingAlgorithmDialogBase( QWidget *parent =
nullptr, Qt::WindowFlags flags =
nullptr );
115 QWidget *mainWidget();
127 bool wasExecuted()
const {
return mExecuted; }
134 QVariantMap results()
const {
return mResults; }
145 virtual QVariantMap getParameterValues() const;
149 void accept() override;
156 void reportError( const QString &error,
bool fatalError );
161 void pushInfo( const QString &info );
166 void pushDebugInfo( const QString &message );
171 void pushCommandInfo( const QString &info );
176 void setPercentage(
double percent );
181 void setProgressText( const QString &text );
186 void pushConsoleInfo( const QString &info );
192 QDialog *createProgressDialog();
196 void closeEvent( QCloseEvent *e ) override;
201 QPushButton *runButton();
206 QPushButton *cancelButton();
211 QDialogButtonBox *buttonBox();
216 QTabWidget *tabWidget();
221 void clearProgress();
228 void setExecuted(
bool executed );
235 void setResults( const QVariantMap &results );
240 void setInfo( const QString &message,
bool isError = false,
bool escapeHtml = true );
255 void hideShortHelp();
268 static QString formatStringForLog( const QString &
string );
280 void toggleCollapsed();
282 void splitterChanged(
int pos,
int index );
283 void linkClicked( const QUrl &url );
284 void algExecuted(
bool successful, const QVariantMap &results );
285 void taskTriggered(
QgsTask *task );
290 QPushButton *mButtonRun =
nullptr;
291 QPushButton *mButtonClose =
nullptr;
292 QByteArray mSplitterState;
293 QToolButton *mButtonCollapse =
nullptr;
296 bool mExecuted = false;
297 QVariantMap mResults;
298 QWidget *mMainWidget =
nullptr;
302 bool mHelpCollapsed = false;
305 void scrollToBottomOfLog();
306 void processEvents();
318 class QgsProcessingAlgorithmProgressDialog :
public QDialog,
private Ui::QgsProcessingProgressDialogBase
327 QgsProcessingAlgorithmProgressDialog( QWidget *parent =
nullptr );
332 QProgressBar *progressBar();
337 QPushButton *cancelButton();
342 QTextEdit *logTextEdit();
346 void reject()
override;
354 #endif // QGSPROCESSINGALGORITHMDIALOGBASE_H Base class for providing feedback from a processing algorithm.
A bar for displaying non-blocking messages to the user.
virtual void setProgressText(const QString &text)
Sets a progress report text string.
Abstract base class for processing algorithms.
Abstract base class for long running background tasks.
virtual void pushDebugInfo(const QString &info)
Pushes an informational message containing debugging helpers from the algorithm.
virtual void pushConsoleInfo(const QString &info)
Pushes a console feedback message from the algorithm.
virtual void pushCommandInfo(const QString &info)
Pushes an informational message containing a command from the algorithm.
QgsTask task which runs a QgsProcessingAlgorithm in a background task.
Contains information about the context in which a processing algorithm is executed.
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.
virtual void pushInfo(const QString &info)
Pushes a general informational message from the algorithm.