QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsproxyprogresstask.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsproxyprogresstask.h
3
----------------------
4
begin : August 2018
5
copyright : (C) 2018 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 QGSPROXYPROGRESSTASK_H
19
#define QGSPROXYPROGRESSTASK_H
20
21
#include "
qgstaskmanager.h
"
22
#include "
qgsvirtuallayerdefinition.h
"
23
24
#include <QWaitCondition>
25
37
class
CORE_EXPORT
QgsProxyProgressTask
:
public
QgsTask
38
{
39
Q_OBJECT
40
41
public
:
45
QgsProxyProgressTask
(
const
QString &
description
,
bool
canCancel
=
false
);
46
47
QgsProxyProgressTask
(
const
QgsProxyProgressTask
&other ) =
delete
;
48
QgsProxyProgressTask
&
operator=
(
const
QgsProxyProgressTask
&other ) =
delete
;
49
56
void
finalize
(
bool
result );
57
58
bool
run
()
override
;
59
65
void
setProxyProgress
(
double
progress
);
66
67
void
cancel
()
override
;
68
69
signals:
70
76
void
canceled
();
77
78
private
:
79
QWaitCondition mNotFinishedWaitCondition;
80
QMutex mNotFinishedMutex;
81
bool
mAlreadyFinished =
false
;
82
bool
mResult =
true
;
83
};
84
96
class
CORE_EXPORT
QgsScopedProxyProgressTask
97
{
98
public
:
102
QgsScopedProxyProgressTask
(
const
QString &description );
103
104
QgsScopedProxyProgressTask
(
const
QgsScopedProxyProgressTask
&other ) =
delete
;
105
QgsScopedProxyProgressTask
&
operator=
(
const
QgsScopedProxyProgressTask
&other ) =
delete
;
106
107
~QgsScopedProxyProgressTask
();
108
112
void
setProgress
(
double
progress );
113
114
private
:
115
QgsProxyProgressTask
*mTask =
nullptr
;
116
117
#ifdef SIP_RUN
118
QgsScopedProxyProgressTask
(
const
QgsScopedProxyProgressTask
&other );
119
#endif
120
121
// SIP generates .cpp code that doesn't compile if commenting out the legit following line.
122
// Q_DISABLE_COPY( QgsScopedProxyProgressTask )
123
};
124
125
#endif
// QGSPROXYPROGRESSTASK_H
QgsProxyProgressTask
A QgsTask shell which proxies progress reports.
Definition
qgsproxyprogresstask.h:38
QgsProxyProgressTask::QgsProxyProgressTask
QgsProxyProgressTask(const QgsProxyProgressTask &other)=delete
QgsProxyProgressTask::setProxyProgress
void setProxyProgress(double progress)
Sets the progress (from 0 to 100) for the proxied operation.
Definition
qgsproxyprogresstask.cpp:53
QgsProxyProgressTask::finalize
void finalize(bool result)
Finalizes the task, with the specified result.
Definition
qgsproxyprogresstask.cpp:30
QgsProxyProgressTask::canceled
void canceled()
Emitted when the task is canceled.
QgsProxyProgressTask::operator=
QgsProxyProgressTask & operator=(const QgsProxyProgressTask &other)=delete
QgsProxyProgressTask::QgsProxyProgressTask
QgsProxyProgressTask(const QString &description, bool canCancel=false)
Constructor for QgsProxyProgressTask, with the specified description.
Definition
qgsproxyprogresstask.cpp:26
QgsScopedProxyProgressTask::operator=
QgsScopedProxyProgressTask & operator=(const QgsScopedProxyProgressTask &other)=delete
QgsScopedProxyProgressTask::QgsScopedProxyProgressTask
QgsScopedProxyProgressTask(const QgsScopedProxyProgressTask &other)=delete
QgsScopedProxyProgressTask::QgsScopedProxyProgressTask
QgsScopedProxyProgressTask(const QString &description)
Constructor for QgsScopedProxyProgressTask, with the specified description.
Definition
qgsproxyprogresstask.cpp:69
QgsTask::progress
double progress() const
Returns the task's progress (between 0.0 and 100.0).
Definition
qgstaskmanager.h:126
QgsTask::run
virtual bool run()=0
Performs the task's operation.
QgsTask::cancel
virtual void cancel()
Notifies the task that it should terminate.
Definition
qgstaskmanager.cpp:98
QgsTask::QgsTask
QgsTask(const QString &description=QString(), QgsTask::Flags flags=AllFlags)
Constructor for QgsTask.
Definition
qgstaskmanager.cpp:36
QgsTask::description
QString description() const
Returns the task's description.
Definition
qgstaskmanager.h:121
QgsTask::setProgress
void setProgress(double progress)
Sets the task's current progress.
Definition
qgstaskmanager.cpp:239
QgsTask::canCancel
bool canCancel() const
Returns true if the task can be canceled.
Definition
qgstaskmanager.h:105
qgstaskmanager.h
qgsvirtuallayerdefinition.h
Generated on
for QGIS API Documentation by
1.17.0