File: qgsscalewidget.sip.in

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; 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: 161
file content (221 lines) | stat: -rw-r--r-- 6,032 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsscalewidget.h                                             *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






class QgsScaleWidget : QWidget
{
%Docstring(signature="appended")
A combobox which lets the user select map scale from predefined list and
highlights nearest to current scale value
%End

%TypeHeaderCode
#include "qgsscalewidget.h"
%End
  public:
    explicit QgsScaleWidget( QWidget *parent /TransferThis/ = 0 );
%Docstring
QgsScaleWidget creates a combobox which lets the user select map scale
from predefined list and highlights nearest to current scale value
%End

    void setShowCurrentScaleButton( bool showCurrentScaleButton );
%Docstring
Sets whether to show a button to set the scale to the current scale of
the map canvas next to the combobox.

.. note::

   the map canvas must be defined to show the button

.. seealso:: :py:func:`showCurrentScaleButton`

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

    bool showCurrentScaleButton();
%Docstring
Returns whether a button to set the scale from map canvas is shown or
not.

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

    void setMapCanvas( QgsMapCanvas *canvas );
%Docstring
Set the map ``canvas`` associated to the current button.
%End

    QString scaleString() const;
%Docstring
Returns the selected scale as a string, e.g. "1:150".

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

    bool setScaleString( const QString &string );
%Docstring
Set the selected scale from a ``string``, e.g. "1:150".

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

    double scale() const;
%Docstring
Returns the selected scale as a double. The scale value indicates the
scale denominator, e.g. 1000.0 for a 1:1000 map.

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

    bool isNull() const;
%Docstring
Returns ``True`` if the widget is currently set to a "null" value.

.. seealso:: :py:func:`setAllowNull`

.. seealso:: :py:func:`setNull`

.. versionadded:: 3.8
%End

    double minScale() const;
%Docstring
Returns the minimum scale, or 0 if no minimum scale set. The ``scale``
value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. Any
scale lower than the minimum scale will automatically be converted to
the minimum scale. Except for 0 which is always allowed.
%End

    static QString toString( double scale );
%Docstring
Helper function to convert a ``scale`` double to scale string. The
``scale`` value indicates the scale denominator, e.g. 1000.0 for a
1:1000 map.

The returned string will be rounded (e.g. 1:1000, not 1:1000.345).

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

    static double toDouble( const QString &scaleString, bool *ok = 0 );
%Docstring
Helper function to convert a scale ``string`` to double. The returned
value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. If
specified, ``ok`` will be set to ``True`` if the string was successfully
interpreted as a scale.

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

    void setAllowNull( bool allowNull );
%Docstring
Sets whether the scale widget can be set to a NULL value.

.. seealso:: :py:func:`allowNull`

.. seealso:: :py:func:`isNull`

.. seealso:: :py:func:`setNull`

.. versionadded:: 3.8
%End

    bool allowNull() const;
%Docstring
Returns ``True`` if the widget can be set to a NULL value.

.. seealso:: :py:func:`setAllowNull`

.. seealso:: :py:func:`isNull`

.. seealso:: :py:func:`setNull`

.. versionadded:: 3.8
%End

    void setPredefinedScales( const QVector<double> &scales );
%Docstring
Sets the list of predefined ``scales`` to show in the widget. List
elements are expected to be scale denominators, e.g. 1000.0 for a 1:1000
map.

If ``scales`` is empty then the default user scale options will be used
instead.

.. versionadded:: 3.38
%End

  public slots:

    void setScale( double scale );
%Docstring
Set the selected scale from a double. The ``scale`` value indicates the
scale denominator, e.g. 1000.0 for a 1:1000 map.

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

    void updateScales( const QStringList &scales = QStringList() );
%Docstring
Sets the list of predefined ``scales`` to show in the widget. List
elements are expected to be valid scale strings, such as "1:1000000".
%End

    void setScaleFromCanvas();
%Docstring
Assigns the current scale from the map canvas, if set.

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

    void setMinScale( double scale );
%Docstring
Set the minimum allowed ``scale``. Set to 0 to disable the minimum
scale. The ``scale`` value indicates the scale denominator, e.g. 1000.0
for a 1:1000 map. Any scale lower than the minimum scale will
automatically be converted to the minimum scale. Except for 0 which is
always allowed.
%End

    void setNull();
%Docstring
Sets the widget to the null value.

This only has an effect if :py:func:`~QgsScaleWidget.allowNull` is
``True``.

.. seealso:: :py:func:`allowNull`

.. seealso:: :py:func:`isNull`

.. versionadded:: 3.8
%End

  signals:

    void scaleChanged( double scale );
%Docstring
Emitted when *user* has finished editing/selecting a new scale. The
``scale`` value indicates the scale denominator, e.g. 1000.0 for a
1:1000 map.
%End

};

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