File: qgsprojectstylesettings.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 (436 lines) | stat: -rw-r--r-- 11,679 bytes parent folder | download | duplicates (7)
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/project/qgsprojectstylesettings.h                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/




class QgsProjectStyleSettings : QObject
{
%Docstring(signature="appended")
Contains settings and properties relating to how a
:py:class:`QgsProject` should handle styling.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsprojectstylesettings.h"
%End
  public:

    QgsProjectStyleSettings( QgsProject *project = 0 );
%Docstring
Constructor for QgsProjectStyleSettings for the specified ``project``.

Ownership is transferred to the ``project``.
%End

    ~QgsProjectStyleSettings();

    QgsSymbol *defaultSymbol( Qgis::SymbolType symbolType ) const /Factory/;
%Docstring
Returns the project default symbol for a given type.

:param symbolType: the symbol type

:return: a symbol pointer or ``None`` if there is no default set

.. note::

   the symbol ownership is transferred to the caller
%End

    void setDefaultSymbol( Qgis::SymbolType symbolType, QgsSymbol *symbol );
%Docstring
Sets the project default symbol for a given type.

:param symbolType: the symbol type
:param symbol: the symbol pointer, set to ``None`` to clear default

.. note::

   the symbol ownership is not transferred
%End

    QgsColorRamp *defaultColorRamp() const /Factory/;
%Docstring
Returns the project default color ramp.

:return: a color ramp pointer or ``None`` if there is no default set

.. note::

   the color ramp ownership is transferred to the caller
%End

    void setDefaultColorRamp( QgsColorRamp *colorRamp );
%Docstring
Sets the project default color ramp.

:param colorRamp: the color ramp, set to ``None`` to clear default

.. note::

   the color ramp ownership is not transferred
%End

    QgsTextFormat defaultTextFormat() const;
%Docstring
Returns the project default text format.

.. note::

   if no default is defined, the returned format will be invalid
%End

    void setDefaultTextFormat( const QgsTextFormat &textFormat );
%Docstring
Sets the project default text format.

:param textFormat: the text format, an invalid format is interpreted as
                   no default
%End

    bool randomizeDefaultSymbolColor() const;
%Docstring
Returns whether the default symbol fill color is randomized.
%End

    void setRandomizeDefaultSymbolColor( bool randomized );
%Docstring
Sets whether the default symbol fill color is randomized.
%End

    double defaultSymbolOpacity() const;
%Docstring
Returns the default symbol opacity.
%End

    void setDefaultSymbolOpacity( double opacity );
%Docstring
Sets the default symbol opacity.
%End

    void reset();
%Docstring
Resets the settings to a default state.
%End

    void removeProjectStyle();
%Docstring
Removes and deletes the project style database.

.. versionadded:: 3.32
%End

    void setProjectStyle( QgsStyle *style /Transfer/ );
%Docstring
Sets the style database to use for the project style.

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

    QgsStyle *projectStyle();
%Docstring
Returns the style database to use for project specific styles.

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

    void setColorModel( Qgis::ColorModel colorModel );
%Docstring
Set the project's color model to ``colorModel``

This sets the default color model used when selecting a color in the
whole application. Any color defined in a different color model than the
one specified here will be converted to this color model when exporting
a layout.

If a color space has already been set and its color model differs from
``colorModel``, the project color space will be reset to invalid one
(This is only true if QGIS is built against Qt 6.8.0 or greater).
:py:func:`setColorSpace` colorSpace()

The color model defaults to :py:class:`Qgis`.ColorModel.Rgb

.. seealso:: :py:func:`colorModel`

.. versionadded:: 3.40
%End

    Qgis::ColorModel colorModel() const;
%Docstring
Returns the project's color model

This model is used as the default color model when selecting a color in
the whole application. Any color defined in a different color model than
the returned model will be converted to this color model when exporting
a layout.

The color model defaults to :py:class:`Qgis`.ColorModel.Rgb

.. seealso:: :py:func:`setColorModel`

.. versionadded:: 3.40
%End

    void setColorSpace( const QColorSpace &colorSpace );
%Docstring
Set the project's current color space to ``colorSpace``. ``colorSpace``
must be a valid RGB or CMYK color space. The color space's ICC profile
will be added as a project attached file.

The project color's space will be added to PDF layout exports when it is
defined (i.e. it is different from the default invalid QColorSpace).

If a color model has already been set and it differs from
``colorSpace``'s color model, the project's color model is set to match
the color space's color model (This is only true if QGIS is built
against Qt 6.8.0 or greater). :py:func:`setColorModel` colorModel()

The color space defaults to an invalid color space.

.. seealso:: :py:func:`colorSpace`

.. versionadded:: 3.40
%End

    QColorSpace colorSpace() const;
%Docstring
Returns the project's color space.

The project color's space will be added to PDF layout exports when it is
defined (i.e. it is different from the default invalid QColorSpace).

The color space defaults to an invalid color space.

.. seealso:: :py:func:`setColorSpace`

.. versionadded:: 3.40
%End

    bool readXml( const QDomElement &element, const QgsReadWriteContext &context, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
%Docstring
Reads the settings's state from a DOM element.

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

    QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Returns a DOM element representing the settings.

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

    QStringList styleDatabasePaths() const;
%Docstring
Returns a list of all style databases (file paths) associated with the
project.

The file paths returned by this method will always be absolute paths.
Depending on the project settings, they may be converted to relative
paths when the project is saved.

.. seealso:: :py:func:`styles`

.. seealso:: :py:func:`addStyleDatabasePath`

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

    QList< QgsStyle * > styles() const;
%Docstring
Returns a list of all the styles associated with the project.

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

    QgsStyle *styleAtPath( const QString &path );
%Docstring
Returns a reference to the style database associated with the project
with matching file ``path``.
%End

    void addStyleDatabasePath( const QString &path );
%Docstring
Adds a style database ``path`` to the project.

Paths can be either style .db databases, or .xml exports of style
databases.

The file path added by this method must always be absolute paths.
Depending on the project settings, they may be converted to relative
paths when the project is saved.

.. seealso:: :py:func:`styleDatabasePaths`

.. seealso:: :py:func:`setStyleDatabasePaths`

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

    void setStyleDatabasePaths( const QStringList &paths );
%Docstring
Sets the ``paths`` to all style databases associated with the project.

Paths can be either style .db databases, or .xml exports of style
databases.

The file paths set by this method must always be absolute paths.
Depending on the project settings, they may be converted to relative
paths when the project is saved.

.. seealso:: :py:func:`addStyleDatabasePath`

.. seealso:: :py:func:`styleDatabasePaths`

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

    QgsCombinedStyleModel *combinedStyleModel();
%Docstring
Returns the combined style model which includes all style databases
associated with the project.

This model also includes :py:func:`QgsStyle.defaultStyle()`.

.. note::

   This is only available on builds based on Qt 5.13 or later.

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

  signals:

    void styleDatabasesChanged();
%Docstring
Emitted whenever the set of style databases associated with the project
is changed.
%End

};

class QgsProjectStyleDatabaseModel : QAbstractListModel
{
%Docstring(signature="appended")
List model representing the style databases associated with a
:py:class:`QgsProject`.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsprojectstylesettings.h"
%End
  public:


    enum class CustomRole /BaseType=IntEnum/
    {
      Style,
      Path
    };

    explicit QgsProjectStyleDatabaseModel( QgsProjectStyleSettings *settings, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsProjectStyleDatabaseModel, showing the styles from
the specified ``settings``.
%End

    virtual int rowCount( const QModelIndex &parent ) const;

    virtual QVariant data( const QModelIndex &index, int role ) const;


    QgsStyle *styleFromIndex( const QModelIndex &index ) const;
%Docstring
Returns the style at the corresponding ``index``.

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

    QModelIndex indexFromStyle( QgsStyle *style ) const;
%Docstring
Returns the model index corresponding to a ``style``.

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

    void setShowDefaultStyle( bool show );
%Docstring
Sets whether the default style should also be included in the model.

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

    bool showDefaultStyle() const;
%Docstring
Returns ``True`` if the model includes the default style.

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

};

class QgsProjectStyleDatabaseProxyModel : QSortFilterProxyModel
{
%Docstring(signature="appended")
A proxy model for filtering :py:class:`QgsProjectStyleDatabaseModel`.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsprojectstylesettings.h"
%End
  public:

    enum class Filter /BaseType=IntFlag/
    {
      FilterHideReadOnly,
    };
    typedef QFlags<QgsProjectStyleDatabaseProxyModel::Filter> Filters;


    QgsProjectStyleDatabaseProxyModel( QgsProjectStyleDatabaseModel *model, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsProjectStyleDatabaseProxyModel, for the specified
style database ``model``.
%End

    virtual bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;


    QgsProjectStyleDatabaseProxyModel::Filters filters() const;
%Docstring
Returns the current filters used for filtering available style.

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

    void setFilters( QgsProjectStyleDatabaseProxyModel::Filters filters );
%Docstring
Sets the current ``filters`` used for filtering available styles.

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

};
QFlags<QgsProjectStyleDatabaseProxyModel::Filter> operator|(QgsProjectStyleDatabaseProxyModel::Filter f1, QFlags<QgsProjectStyleDatabaseProxyModel::Filter> f2);



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