File: qgsmaplayerutils.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 (107 lines) | stat: -rw-r--r-- 3,493 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
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsmaplayerutils.h                                          *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsMapLayerUtils
{
%Docstring(signature="appended")
Contains utility functions for working with map layers.

.. versionadded:: 3.20
%End

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

    static QgsRectangle combinedExtent( const QList<QgsMapLayer *> &layers, const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &transformContext );
%Docstring
Returns the combined extent of a list of ``layers``.

The ``crs`` argument specifies the desired coordinate reference system
for the combined extent.
%End

    static QgsAbstractDatabaseProviderConnection *databaseConnection( const QgsMapLayer *layer ) /Factory/;
%Docstring
Creates and returns the (possibly ``None``) database connection for a
``layer``. Ownership is transferred to the caller.

.. versionadded:: 3.22
%End

    static bool layerSourceMatchesPath( const QgsMapLayer *layer, const QString &path );
%Docstring
Returns ``True`` if the source of the specified ``layer`` matches the
given ``path``.

This method can be used to test whether a layer is associated with a
file path.

.. versionadded:: 3.22
%End

    static bool updateLayerSourcePath( QgsMapLayer *layer, const QString &newPath );
%Docstring
Updates a ``layer``'s data source, replacing its data source with a path
referring to ``newPath``.

Returns ``True`` if the layer was updated, or ``False`` if the layer was
not updated (e.g. it uses a data provider which does not specify paths
in a layer URI.

.. versionadded:: 3.22
%End

    static QList< QgsMapLayer * > sortLayersByType( const QList< QgsMapLayer * > &layers, const QList< Qgis::LayerType > &order );
%Docstring
Sorts a list of map ``layers`` by their layer type, respecting the
``order`` of types specified.

Layer types which appear earlier in the ``order`` list will result in
matching layers appearing earlier in the result list.

.. versionadded:: 3.26
%End

    static QString launderLayerName( const QString &name );
%Docstring
Launders a layer's name, converting it into a format which is general
suitable for file names or database layer names.

Specifically this method:

- Converts the name to lowercase
- Replaces spaces by underscore characters
- Removes any characters which are not alphanumeric or '_'.

.. versionadded:: 3.28
%End

    static bool isOpenStreetMapLayer( QgsMapLayer *layer );
%Docstring
Returns ``True`` if the layer is served by OpenStreetMap server.

.. versionadded:: 3.40
%End

};



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