18#include "moc_qgsfeedback.cpp"
24 QgsFeedback *parentFeedback,
double startPercentage,
double endPercentage )
26 auto scaledFeedback = std::make_unique<QgsFeedback>();
29 const double ratio = ( endPercentage - startPercentage ) / 100.0;
31 parentFeedback, [parentFeedback, startPercentage, ratio](
double progress )
33 parentFeedback->setProgress( startPercentage + progress * ratio );
38 return scaledFeedback;
void progressChanged(double progress)
Emitted when the feedback object reports a progress change.
void canceled()
Internal routines can connect to this signal if they use event loop.
QgsFeedback(QObject *parent=nullptr)
Construct a feedback object.
void cancel()
Tells the internal routines that the current operation should be canceled. This should be run by the ...
static std::unique_ptr< QgsFeedback > createScaledFeedback(QgsFeedback *parentFeedback, double startPercentage, double endPercentage)
Returns a feedback object whose [0, 100] progression range will be mapped to parentFeedback [startPer...
double progress() const
Returns the current progress reported by the feedback object.