QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsfeedback.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfeedback.cpp
3
--------------------------------------
4
Date : December 2025
5
Copyright : (C) 2025 by Even Rouault
6
Email : event dot rouault at spatialys dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#include "
qgsfeedback.h
"
17
18
#include "moc_qgsfeedback.cpp"
19
20
QgsFeedback::~QgsFeedback
() =
default
;
21
22
/* static */
23
std::unique_ptr<QgsFeedback>
QgsFeedback::createScaledFeedback
(
QgsFeedback
*parentFeedback,
double
startPercentage,
double
endPercentage )
24
{
25
auto
scaledFeedback = std::make_unique<QgsFeedback>();
26
if
( parentFeedback )
27
{
28
const
double
ratio = ( endPercentage - startPercentage ) / 100.0;
29
QObject::connect( scaledFeedback.get(), &
QgsFeedback::progressChanged
, parentFeedback, [parentFeedback, startPercentage, ratio](
double
progress
) {
30
parentFeedback->setProgress( startPercentage + progress * ratio );
31
} );
32
QObject::connect( scaledFeedback.get(), &
QgsFeedback::canceled
, parentFeedback, &
QgsFeedback::cancel
);
33
}
34
return
scaledFeedback;
35
}
QgsFeedback::progressChanged
void progressChanged(double progress)
Emitted when the feedback object reports a progress change.
QgsFeedback::canceled
void canceled()
Internal routines can connect to this signal if they use event loop.
QgsFeedback::QgsFeedback
QgsFeedback(QObject *parent=nullptr)
Construct a feedback object.
Definition
qgsfeedback.h:48
QgsFeedback::cancel
void cancel()
Tells the internal routines that the current operation should be canceled. This should be run by the ...
Definition
qgsfeedback.h:123
QgsFeedback::createScaledFeedback
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...
Definition
qgsfeedback.cpp:23
QgsFeedback::progress
double progress() const
Returns the current progress reported by the feedback object.
Definition
qgsfeedback.h:81
QgsFeedback::~QgsFeedback
~QgsFeedback() override
qgsfeedback.h
Generated on
for QGIS API Documentation by
1.17.0