27 Commits

Author SHA1 Message Date
Simon Lopez
1c2c2b3252 Add QgsMapLayer::profileSource
This commit adds a virtual method to QgsMapLayer to enable the creation of custom
elevation profiles for any type of layer.
The methods returns a pointer to a helper class of type
QgsAbstractProfileSource which is a factory for profile generators
(cf. documentation for QgsAbstractProfileSource).
Existing layers that derive from QgsAbstractProfileSource just override
this method returning a *this* pointer.
As the method is *sipified* it can be used in python to declare custom
profile source for classes derived from PluginLayer (ownership of the
QgsAbstractProfileSource must then be managed on the python side).
2025-10-01 12:04:04 +00:00
Nyall Dawson
7f4e1fde45 Fix ambiguity in QgsMapLayer::saveStyleToDatabase API
Don't require successful generation of both QML AND SLD, and return descriptive results flags
2025-06-24 22:23:40 +00:00
Nyall Dawson
f1b8682e36 Improve API for exporting to SLD
Deprecate old methods and make methods always take QgsSldExportContext.
Add capacity to QgsSldExportContext to collect export errors and
warnings.

The old API had no way to reliably report errors/warnings during
export to users.
2025-05-04 17:55:25 +10:00
Nyall Dawson
3f6b490218 Sipify 2025-04-02 11:11:10 +10:00
Nyall Dawson
7b56629478 Sipify 2025-03-27 14:00:26 +10:00
qgis-bot
eb1ce83af1 auto sipify 🍺 2024-12-03 07:47:10 +00:00
Nyall Dawson
f21722a0f1 [sipify] Minor cleanup to auto additions
Condense injections into a single block instead of multiple
separate blocks
2024-09-09 16:56:29 +10:00
Nyall Dawson
cfd251e7f7 Capture signal arguments 2024-09-08 16:06:22 +10:00
Nyall Dawson
1f27fc627a [pyqgis] Wrap unambiguously static methods in staticmethod
sip doesn't use the standard Python staticmethod type for defining
static methods, which means that standard means of testing
for a static method (like `isinstance(..., staticmethod)`) fail
with any PyQGIS static methods.

This causes issues with lint tools, which incorrectly flag
calls to QGIS static methods as missing self arguments. It also
breaks detection of static methods in the sphinx PyQGIS docs,
so all static methods are shown as non-static.

Work around this in sipify, by wrapping unambiguously static
methods in staticmethod wrappers.
2024-08-14 22:08:41 +10:00
Nyall Dawson
dc68f03f88 Be tolerant against optional sip modules 2024-08-14 13:05:46 +10:00
Nyall Dawson
ed19d996b2 Collect attribute docstrings for PyQGIS documentation 2024-08-14 13:05:46 +10:00
Nyall Dawson
af6c08bb26 Move QgsMapLayerType to separate generic header for core enums
Avoids the need to include the whole qgsmaplayer.h header and
all its dependancies when only the QgsMapLayerType enum is required.
2021-05-17 16:09:13 +10:00
Peter Petrik
29113a89c1 fix some checks and building 2020-10-27 05:29:14 +10:00
Peter Petrik
8ea34de8a2 restore accidentally deleted files 2020-10-27 05:29:14 +10:00
Peter Petrik
8536c564fb add ept provider 2020-10-27 05:29:14 +10:00
Peter Petrik
de6f4d6ad8 hook point cloud layer type to the rest of the code 2020-10-27 05:29:14 +10:00
Nyall Dawson
21a2599d0d Move annotation layer renderer to own file 2020-08-05 16:27:09 +10:00
Nyall Dawson
35d9a657c8 Add AnnotationLayer to layer item type enum, silence warnings 2020-08-05 16:27:09 +10:00
Martin Dobias
5ec1890643 Moved to proper QgsMapLayer subclass + icon + optional tile borders 2020-03-27 12:08:40 +01:00
Denis Rouzaud
60682885c0
Small tweak to enum Python docs (#9631)
original credits to @nyalldawson
2019-03-26 14:00:37 -05:00
Denis Rouzaud
e232817e5b add missing doc 2019-03-25 11:00:17 -05:00
Denis Rouzaud
9a6ddbd5c1 also monkey patch the former enum type 2019-03-24 21:40:33 -05:00
Denis Rouzaud
38c2d4a03d fix dox for unnested enums 2019-03-24 21:40:33 -05:00
Denis Rouzaud
f45314245c run sipify 2019-03-24 21:40:33 -05:00
Denis Rouzaud
375a0aa253 create scope based enum for QgsMapLayer::LayerType >> QgsMapLayerType
the enum is moved out of the class
this will allow forward declaration more easily since the enum is not nested in the class
2019-03-24 21:40:33 -05:00
Denis Rouzaud
15e0d873d9 select categories in copy style in legend menu entry
not working yet, just set the menu entries
QgsMapLayerStyle::StyleCategory has moved to QgsMapLayer to avoid making QgsMapLayerStyle a QObject and they are mostly used in QgsMapLayer
2018-09-14 16:35:30 +10:00
Denis Rouzaud
89830f614e
create QgsMapLayer::LayerFlags for Searchable, Identifiable and Removable (#7815)
* create QgsMapLayer::LayerFlags for Searchable, Identifiable and Removable

this brings back the information previously saved in the project node back to the layer node
this will allow to embed this information in layer styles

* skip unexisting flag node to avoid setting wrong value for flag

* mark QgsProject::(set)requiredLayers as deprecated

* better API docs

* use new API in current code

* more docs and more old API fixes

* fix bad conversion

* more old API fix

* add missing SIP_OUT

* s/testFlags/testFlag

* fix var name

* adapt project test to test flags

* remove debug calls

* fixeS
2018-09-08 07:54:21 -04:00