File: qgsfeedback.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (147 lines) | stat: -rw-r--r-- 4,875 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsfeedback.h                                               *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/




class QgsFeedback : QObject
{
%Docstring(signature="appended")
Base class for feedback objects to be used for cancellation of something
running in a worker thread.

The class may be used as is or it may be subclassed for extended
functionality for a particular operation (e.g. report progress or pass
some data for preview).

When :py:func:`~cancel` is called, the internal code has two options to
check for cancellation state:

- if the worker thread uses an event loop (e.g. for network communication), the code can make a queued connection to :py:func:`~canceled` signal and handle the cancellation in its slot.
- if the worker thread does not use an event loop, it can poll :py:func:`~isCanceled` method regularly to see if the operation should be canceled.

The class is meant to be created and destroyed in the main thread.

For map rendering, the object may be created in constructor of a
:py:class:`QgsMapLayerRenderer` subclass and available with
:py:func:`QgsMapLayerRenderer.feedback()` method. When a map rendering
job gets canceled, the :py:func:`~cancel` method is called on the
feedback object of all layers.
%End

%TypeHeaderCode
#include "qgsfeedback.h"
%End
  public:
    QgsFeedback( QObject *parent /TransferThis/ = 0 );
%Docstring
Construct a feedback object
%End

    bool isCanceled() const /HoldGIL/;
%Docstring
Tells whether the operation has been canceled already
%End

    void setProgress( double progress );
%Docstring
Sets the current progress for the feedback object. The ``progress``
argument is in percentage and valid values range from 0-100.

.. seealso:: :py:func:`progress`

.. seealso:: :py:func:`progressChanged`
%End

    double progress() const /HoldGIL/;
%Docstring
Returns the current progress reported by the feedback object. Depending
on how the feedback object is used progress reporting may not be
supported. The returned value is in percentage and ranges from 0-100.

.. seealso:: :py:func:`setProgress`

.. seealso:: :py:func:`progressChanged`
%End

    unsigned long long processedCount() const /HoldGIL/;
%Docstring
Returns the current processed objects count reported by the feedback
object. Depending on how the feedback object is used processed count
reporting may not be supported. The returned value is an unsigned long
integer and starts from 0.

.. seealso:: :py:func:`setProcessedCount`

.. seealso:: :py:func:`processedCountChanged`

.. versionadded:: 3.24
%End

    void setProcessedCount( unsigned long long processedCount );
%Docstring
Sets the current processed objects count for the feedback object. The
``processedCount`` argument is an unsigned long integer and starts from
0.

.. seealso:: :py:func:`processedCount`

.. seealso:: :py:func:`processedCountChanged`

.. versionadded:: 3.24
%End

  public slots:

    void cancel();
%Docstring
Tells the internal routines that the current operation should be
canceled. This should be run by the main thread
%End

  signals:
    void canceled();
%Docstring
Internal routines can connect to this signal if they use event loop
%End

    void progressChanged( double progress );
%Docstring
Emitted when the feedback object reports a progress change. Depending on
how the feedback object is used progress reporting may not be supported.
The ``progress`` argument is in percentage and ranges from 0-100.

.. seealso:: :py:func:`setProgress`

.. seealso:: :py:func:`progress`
%End

    void processedCountChanged( unsigned long long processedCount );
%Docstring
Emitted when the feedback object reports a change in the number of
processed objects. Depending on how the feedback object is used
processed count reporting may not be supported. The ``processedCount``
argument is an unsigned long integer and starts from 0.

.. seealso:: :py:func:`setProgress`

.. seealso:: :py:func:`progress`

.. versionadded:: 3.24
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsfeedback.h                                               *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/