QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
qgsprocessingfeedback.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingfeedback.h
3  -----------------------
4  begin : December 2016
5  copyright : (C) 2016 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSPROCESSINGFEEDBACK_H
19 #define QGSPROCESSINGFEEDBACK_H
20 
21 #include "qgis_core.h"
22 #include "qgsfeedback.h"
23 #include "qgsmessagelog.h"
24 
26 
37 class CORE_EXPORT QgsProcessingFeedback : public QgsFeedback
38 {
39  Q_OBJECT
40 
41  public:
42 
49  virtual void setProgressText( const QString &text );
50 
56  virtual void reportError( const QString &error, bool fatalError = false );
57 
66  virtual void pushInfo( const QString &info );
67 
76  virtual void pushCommandInfo( const QString &info );
77 
85  virtual void pushDebugInfo( const QString &info );
86 
94  virtual void pushConsoleInfo( const QString &info );
95 
100  void pushVersionInfo( const QgsProcessingProvider *provider = nullptr );
101 
102 };
103 
104 
118 {
119  Q_OBJECT
120 
121  public:
122 
129 
134  void setCurrentStep( int step );
135 
136  void setProgressText( const QString &text ) override;
137  void reportError( const QString &error, bool fatalError ) override;
138  void pushInfo( const QString &info ) override;
139  void pushCommandInfo( const QString &info ) override;
140  void pushDebugInfo( const QString &info ) override;
141  void pushConsoleInfo( const QString &info ) override;
142 
143  private slots:
144 
145  void updateOverallProgress( double progress );
146 
147  private:
148 
149  int mChildSteps = 0;
150  int mCurrentStep = 0;
151  QgsProcessingFeedback *mFeedback = nullptr;
152 };
153 
154 #endif // QGSPROCESSINGFEEDBACK_H
155 
156 
virtual void pushConsoleInfo(const QString &info)
Pushes a console feedback message from the algorithm.
Base class for providing feedback from a processing algorithm.
Processing feedback object for multi-step operations.
virtual void pushCommandInfo(const QString &info)
Pushes an informational message containing a command from the algorithm.
Abstract base class for processing providers.
Base class for feedback objects to be used for cancellation of something running in a worker thread...
Definition: qgsfeedback.h:44
virtual void setProgressText(const QString &text)
Sets a progress report text string.
virtual void pushInfo(const QString &info)
Pushes a general informational message from the algorithm.
virtual void pushDebugInfo(const QString &info)
Pushes an informational message containing debugging helpers from the algorithm.
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.