QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
|
Base class for providing feedback from a processing algorithm. More...
#include <qgsprocessingfeedback.h>
Public Member Functions | |
QgsProcessingFeedback (bool logFeedback=true) | |
Constructor for QgsProcessingFeedback. | |
virtual QString | htmlLog () const |
Returns the HTML formatted contents of the log, which contains all messages pushed to the feedback object. | |
virtual void | pushCommandInfo (const QString &info) |
Pushes an informational message containing a command from the algorithm. | |
virtual void | pushConsoleInfo (const QString &info) |
Pushes a console feedback message from the algorithm. | |
virtual void | pushDebugInfo (const QString &info) |
Pushes an informational message containing debugging helpers from the algorithm. | |
virtual void | pushFormattedMessage (const QString &html, const QString &text) |
Pushes a pre-formatted message from the algorithm. | |
void | pushFormattedResults (const QgsProcessingAlgorithm *algorithm, QgsProcessingContext &context, const QVariantMap &results) |
Pushes a summary of the execution results to the log. | |
virtual void | pushInfo (const QString &info) |
Pushes a general informational message from the algorithm. | |
void | pushVersionInfo (const QgsProcessingProvider *provider=nullptr) |
Pushes a summary of the QGIS (and underlying library) version information to the log. | |
virtual void | pushWarning (const QString &warning) |
Pushes a warning informational message from the algorithm. | |
virtual void | reportError (const QString &error, bool fatalError=false) |
Reports that the algorithm encountered an error while executing. | |
virtual void | setProgressText (const QString &text) |
Sets a progress report text string. | |
virtual QString | textLog () const |
Returns the plain text contents of the log, which contains all messages pushed to the feedback object. | |
![]() | |
QgsFeedback (QObject *parent=nullptr) | |
Construct a feedback object. | |
bool | isCanceled () const |
Tells whether the operation has been canceled already. | |
unsigned long long | processedCount () const |
Returns the current processed objects count reported by the feedback object. | |
double | progress () const |
Returns the current progress reported by the feedback object. | |
void | setProcessedCount (unsigned long long processedCount) |
Sets the current processed objects count for the feedback object. | |
void | setProgress (double progress) |
Sets the current progress for the feedback object. | |
Additional Inherited Members | |
![]() | |
void | cancel () |
Tells the internal routines that the current operation should be canceled. This should be run by the main thread. | |
![]() | |
void | canceled () |
Internal routines can connect to this signal if they use event loop. | |
void | processedCountChanged (unsigned long long processedCount) |
Emitted when the feedback object reports a change in the number of processed objects. | |
void | progressChanged (double progress) |
Emitted when the feedback object reports a progress change. | |
Base class for providing feedback from a processing algorithm.
This base class implementation silently ignores all feedback reported by algorithms. Subclasses of QgsProcessingFeedback can be used to log this feedback or report it to users via the GUI.
Definition at line 37 of file qgsprocessingfeedback.h.
QgsProcessingFeedback::QgsProcessingFeedback | ( | bool | logFeedback = true | ) |
Constructor for QgsProcessingFeedback.
If logFeedback is true
, then all feedback received will be directed to QgsMessageLog.
Definition at line 30 of file qgsprocessingfeedback.cpp.
|
virtual |
Returns the HTML formatted contents of the log, which contains all messages pushed to the feedback object.
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 180 of file qgsprocessingfeedback.cpp.
|
virtual |
Pushes an informational message containing a command from the algorithm.
This is usually used to report commands which are executed in an external application or as subprocesses.
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 96 of file qgsprocessingfeedback.cpp.
|
virtual |
Pushes a console feedback message from the algorithm.
This is used to report the output from executing an external command or subprocess.
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 114 of file qgsprocessingfeedback.cpp.
|
virtual |
Pushes an informational message containing debugging helpers from the algorithm.
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 105 of file qgsprocessingfeedback.cpp.
|
virtual |
Pushes a pre-formatted message from the algorithm.
This can be used to push formatted HTML messages to the feedback object. A plain text version of the message must also be specified.
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 87 of file qgsprocessingfeedback.cpp.
void QgsProcessingFeedback::pushFormattedResults | ( | const QgsProcessingAlgorithm * | algorithm, |
QgsProcessingContext & | context, | ||
const QVariantMap & | results | ||
) |
Pushes a summary of the execution results to the log.
Definition at line 152 of file qgsprocessingfeedback.cpp.
|
virtual |
Pushes a general informational message from the algorithm.
This can be used to report feedback which is neither a status report or an error, such as "Found 47 matching features".
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 78 of file qgsprocessingfeedback.cpp.
void QgsProcessingFeedback::pushVersionInfo | ( | const QgsProcessingProvider * | provider = nullptr | ) |
Pushes a summary of the QGIS (and underlying library) version information to the log.
Definition at line 123 of file qgsprocessingfeedback.cpp.
|
virtual |
Pushes a warning informational message from the algorithm.
This should only be used sparsely as to maintain the importance of visual queues associated to this type of message.
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 69 of file qgsprocessingfeedback.cpp.
|
virtual |
Reports that the algorithm encountered an error while executing.
If fatalError is true
then the error prevented the algorithm from executing.
Reimplemented in QgsProcessingBatchFeedback, and QgsProcessingMultiStepFeedback.
Definition at line 60 of file qgsprocessingfeedback.cpp.
|
virtual |
Sets a progress report text string.
This can be used in conjunction with setProgress() to provide detailed progress reports, such as "Transformed 4 of 5 layers".
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 36 of file qgsprocessingfeedback.cpp.
|
virtual |
Returns the plain text contents of the log, which contains all messages pushed to the feedback object.
Reimplemented in QgsProcessingMultiStepFeedback.
Definition at line 185 of file qgsprocessingfeedback.cpp.