File: qgsmaplayerutils.sip.in

package info (click to toggle)
qgis 3.34.7%2Bdfsg-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 1,087,388 kB
  • sloc: cpp: 1,440,033; python: 234,418; xml: 23,096; perl: 3,499; sh: 3,364; ansic: 2,219; sql: 2,130; yacc: 1,063; lex: 577; javascript: 540; lisp: 411; makefile: 155
file content (93 lines) | stat: -rw-r--r-- 3,326 bytes parent folder | download | duplicates (4)
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
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsmaplayerutils.h                                          *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.pl 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

};



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