QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsProcessingMultiStepFeedback Class Reference

Processing feedback object for multi-step operations. More...

#include <qgsprocessingfeedback.h>

Inheritance diagram for QgsProcessingMultiStepFeedback:
Inheritance graph
[legend]

Public Member Functions

 QgsProcessingMultiStepFeedback (int steps, QgsProcessingFeedback *feedback)
 Constructor for QgsProcessingMultiStepFeedback, for a process with the specified number of steps.
 
QString htmlLog () const override
 Returns the HTML formatted contents of the log, which contains all messages pushed to the feedback object.
 
void pushCommandInfo (const QString &info) override
 Pushes an informational message containing a command from the algorithm.
 
void pushConsoleInfo (const QString &info) override
 Pushes a console feedback message from the algorithm.
 
void pushDebugInfo (const QString &info) override
 Pushes an informational message containing debugging helpers from the algorithm.
 
void pushFormattedMessage (const QString &html, const QString &text) override
 Pushes a pre-formatted message from the algorithm.
 
void pushInfo (const QString &info) override
 Pushes a general informational message from the algorithm.
 
void pushWarning (const QString &warning) override
 Pushes a warning informational message from the algorithm.
 
void reportError (const QString &error, bool fatalError=false) override
 Reports that the algorithm encountered an error while executing.
 
void setCurrentStep (int step)
 Sets the step which is being executed.
 
void setProgressText (const QString &text) override
 Sets a progress report text string.
 
QString textLog () const override
 Returns the plain text contents of the log, which contains all messages pushed to the feedback object.
 
- Public Member Functions inherited from QgsProcessingFeedback
 QgsProcessingFeedback (bool logFeedback=true)
 Constructor for QgsProcessingFeedback.
 
void pushFormattedResults (const QgsProcessingAlgorithm *algorithm, QgsProcessingContext &context, const QVariantMap &results)
 Pushes a summary of the execution results to the log.
 
void pushVersionInfo (const QgsProcessingProvider *provider=nullptr)
 Pushes a summary of the QGIS (and underlying library) version information to the log.
 
- Public Member Functions inherited from QgsFeedback
 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

- Public Slots inherited from QgsFeedback
void cancel ()
 Tells the internal routines that the current operation should be canceled. This should be run by the main thread.
 
- Signals inherited from QgsFeedback
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.
 

Detailed Description

Processing feedback object for multi-step operations.

A processing feedback object which proxies its calls to an underlying feedback object, but scales overall progress reports to account for a number of child steps which each report their own feedback.

Definition at line 190 of file qgsprocessingfeedback.h.

Constructor & Destructor Documentation

◆ QgsProcessingMultiStepFeedback()

QgsProcessingMultiStepFeedback::QgsProcessingMultiStepFeedback ( int  steps,
QgsProcessingFeedback feedback 
)

Constructor for QgsProcessingMultiStepFeedback, for a process with the specified number of steps.

This feedback object will proxy calls to the specified feedback object.

Definition at line 194 of file qgsprocessingfeedback.cpp.

Member Function Documentation

◆ htmlLog()

QString QgsProcessingMultiStepFeedback::htmlLog ( ) const
overridevirtual

Returns the HTML formatted contents of the log, which contains all messages pushed to the feedback object.

See also
textLog()
Since
QGIS 3.14

Reimplemented from QgsProcessingFeedback.

Definition at line 248 of file qgsprocessingfeedback.cpp.

◆ pushCommandInfo()

void QgsProcessingMultiStepFeedback::pushCommandInfo ( const QString &  info)
overridevirtual

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.

See also
pushWarning()
pushInfo()
pushDebugInfo()
pushConsoleInfo()

Reimplemented from QgsProcessingFeedback.

Definition at line 228 of file qgsprocessingfeedback.cpp.

◆ pushConsoleInfo()

void QgsProcessingMultiStepFeedback::pushConsoleInfo ( const QString &  info)
overridevirtual

Pushes a console feedback message from the algorithm.

This is used to report the output from executing an external command or subprocess.

See also
pushWarning()
pushInfo()
pushDebugInfo()
pushCommandInfo()

Reimplemented from QgsProcessingFeedback.

Definition at line 238 of file qgsprocessingfeedback.cpp.

◆ pushDebugInfo()

void QgsProcessingMultiStepFeedback::pushDebugInfo ( const QString &  info)
overridevirtual

Pushes an informational message containing debugging helpers from the algorithm.

See also
pushWarning()
pushInfo()
pushCommandInfo()
pushConsoleInfo()

Reimplemented from QgsProcessingFeedback.

Definition at line 233 of file qgsprocessingfeedback.cpp.

◆ pushFormattedMessage()

void QgsProcessingMultiStepFeedback::pushFormattedMessage ( const QString &  html,
const QString &  text 
)
overridevirtual

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.

See also
pushInfo()
pushWarning()
pushCommandInfo()
pushDebugInfo()
pushConsoleInfo()
Since
QGIS 3.36

Reimplemented from QgsProcessingFeedback.

Definition at line 243 of file qgsprocessingfeedback.cpp.

◆ pushInfo()

void QgsProcessingMultiStepFeedback::pushInfo ( const QString &  info)
overridevirtual

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".

See also
pushFormattedMessage()
pushWarning()
pushCommandInfo()
pushDebugInfo()
pushConsoleInfo()

Reimplemented from QgsProcessingFeedback.

Definition at line 223 of file qgsprocessingfeedback.cpp.

◆ pushWarning()

void QgsProcessingMultiStepFeedback::pushWarning ( const QString &  warning)
overridevirtual

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.

See also
pushInfo()
pushCommandInfo()
pushDebugInfo()
pushConsoleInfo()
Since
QGIS 3.16.2

Reimplemented from QgsProcessingFeedback.

Definition at line 218 of file qgsprocessingfeedback.cpp.

◆ reportError()

void QgsProcessingMultiStepFeedback::reportError ( const QString &  error,
bool  fatalError = false 
)
overridevirtual

Reports that the algorithm encountered an error while executing.

If fatalError is true then the error prevented the algorithm from executing.

Reimplemented from QgsProcessingFeedback.

Definition at line 213 of file qgsprocessingfeedback.cpp.

◆ setCurrentStep()

void QgsProcessingMultiStepFeedback::setCurrentStep ( int  step)

Sets the step which is being executed.

This is used to scale the current progress to account for progress through the overall process.

Definition at line 202 of file qgsprocessingfeedback.cpp.

◆ setProgressText()

void QgsProcessingMultiStepFeedback::setProgressText ( const QString &  text)
overridevirtual

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".

See also
setProgress()

Reimplemented from QgsProcessingFeedback.

Definition at line 208 of file qgsprocessingfeedback.cpp.

◆ textLog()

QString QgsProcessingMultiStepFeedback::textLog ( ) const
overridevirtual

Returns the plain text contents of the log, which contains all messages pushed to the feedback object.

See also
htmlLog()
Since
QGIS 3.14

Reimplemented from QgsProcessingFeedback.

Definition at line 253 of file qgsprocessingfeedback.cpp.


The documentation for this class was generated from the following files: