19757 Commits

Author SHA1 Message Date
Nyall Dawson
3d3f3f7f59 Promote more Qgis enums to enum classes, add Q_ENUM 2021-05-28 11:07:25 +10:00
Nyall Dawson
005a0ad093 Sipify 2021-05-27 13:44:15 +10:00
Nyall Dawson
b4fea529f1 Promote Qgis::DataType to enum class 2021-05-27 13:44:15 +10:00
Nyall Dawson
aa93d03ca9 Promote QgsDataItem enums to enum classes, move to Qgis 2021-05-27 13:38:54 +10:00
Denis Rouzaud
35c557a234 run sipify 2021-05-26 14:30:54 +02:00
Alessandro Pasotti
cf45b6b23f Integrate the setLayers docs 2021-05-26 10:49:49 +02:00
Nyall Dawson
86b3459eea Add a flag which can be set on QgsSymbols to indicate that a renderer
should use symbol levels whenever that symbol is used by the renderer

Not exposed to users -- only settable via API, but IS saved in the
symbol's XML definition and restored when loading a symbol from XML.
2021-05-26 18:26:44 +10:00
Matthias Kuhn
92639aef64
Merge pull request #41208 from rldhont/flag-read-extent-from-xml
QgsMapLayer::ReadFlag::FlagReadExtentFromXml to extend vector layer read capabilities to other layer types
2021-05-26 10:14:04 +02:00
Nyall Dawson
68e7cd6609 Don't show symbol levels actions in renderer widgets for renderers
which are subrenderers for other renderers

Symbol layers have no effect in this situation (e.g. when a categorized
renderer is used as a subrenderer for point displacement renderer), so
don't show the option in the GUI
2021-05-26 11:50:44 +10:00
Nyall Dawson
f7f43e08c6 Fix memory leaks in renderer widgets 2021-05-26 11:50:44 +10:00
Nyall Dawson
f3f4c17c5f Use a safer approach to update renderers after symbol levels are changed
Instead of directly changing the renderer in place in the symbol levels
widget, we delegate responsibility for handling the changes to symbol
levels to the parent QgsRendererWidget subclass. This allows us to
implement different logic in the various subclasses which correctly
handle how that particular widget subclass should update any internal
symbol references and ultimately update the renderer.

Fixes instability and crashes after editing symbol levels.

Fixes #42671
2021-05-26 11:50:44 +10:00
Nyall Dawson
c3e01e5725 Add destructors to permit forward declaration 2021-05-26 08:14:13 +10:00
komima
8cea1789af
Fix Python module enviroment setup on Windows
- Trim trailing newline when reading .env lines
- Skip empty, commented and non "key=value" lines
- Allow = chars in values using maxsplit=1
- No special quote handling, use values as is

Fixes #43308
2021-05-26 07:11:57 +10:00
Denis Rouzaud
d2be87210a
fix PyQGIS API docs building (#43387)
* fix PyQGIS API docs building

The current building of the PyQGIS API doc relies on the fact that the first line is a signature.
If not given, it should be empty.

* Update qgssettingsentry.py
2021-05-25 17:26:56 +02:00
Nyall Dawson
60f48bc6a2
Add typehint for QgsPoint constructor (#43385) 2021-05-25 15:20:59 +02:00
Nyall Dawson
615bbd8163 Fix SIP_HOLDGIL annotations 2021-05-25 21:07:50 +10:00
Nyall Dawson
2b6c3c1db2 Fix PyQGIS QgsLineString constructor only accepts lists of QgsPoint,
not QgsPointXY as indicated by the documentation

Also add support for constructing QgsLineString using arrays of
arrays of floats, given that we're having to hand-roll sip conversion
code anyway!

Now the following is supported:

  line = QgsLineString([[1,2], [3,4], [5,6]])

which is much nicer and more "pythonic" then the explicit
QgsPoint/QgsPointXY sequences!

Fixes #43200
2021-05-25 21:07:50 +10:00
Harrissou Sant-anna
b8fe026de3
Merge pull request #43368 from DelazJ/temporalTypos
Fix typos in temporal docs
2021-05-25 10:50:07 +02:00
Nyall Dawson
b190c8f06b [labeling] Default to cartographic placement mode for point layers
Results in much nicer label placement, so should be the default mode
2021-05-25 16:39:15 +10:00
Nyall Dawson
e7c4c84ae3 [labeling][api] Add api to supress unplaced label visibility for
a single layer

Not exposed anywhere, for PyQGIS use only
2021-05-25 16:11:53 +10:00
Nyall Dawson
aba8ddaa48 Make QgsMapCanvas a QgsExpressionContextGenerator 2021-05-25 11:45:14 +10:00
Nyall Dawson
afd912061a Fix build 2021-05-24 14:19:01 +10:00
Nyall Dawson
e4a12e5fd0 Add equality operator to QgsReadWriteContext::ReadWriteMessage 2021-05-24 14:19:01 +10:00
Nyall Dawson
5f9d7b4809 Raise a user-visible warning message if fonts referenced in a QGIS
project are not available when loading that project on a system
without the required fonts installed

Currently shown for any QgsTextForamt or font marker symbol layer
restored when opening the project
2021-05-24 14:19:01 +10:00
Nyall Dawson
b086e6e656 Mark QgsReadWriteContext::pushMessage as const, mutable
Avoids the need to remove const from all the QgsReadWriteContext
references used throughout QGIS XML loading just to be able to
push warning messages to the context.
2021-05-24 14:19:01 +10:00
Nyall Dawson
2bed84d24a Sipify 2021-05-24 12:16:21 +10:00
Nyall Dawson
5ded8b6643 __repr__ fro QgsSymbolLayerReference, QgsSymbolLayerId 2021-05-24 12:16:21 +10:00
Nyall Dawson
22c2d7213b Remove unnecessary includes of qgssymbollayerreference.h 2021-05-24 12:16:21 +10:00
Nyall Dawson
adab3fe6a1 Dox 2021-05-24 10:11:37 +10:00
Nyall Dawson
0d768faa43 Add QgsAbstractGeometry::simplifiedTypeRef
Returns a reference to the simplest lossless representation of this geometry,
e.g. if the geometry is a multipart geometry type with a single member geometry,
a reference to that part will be returned.

This method employs the following logic:

- For multipart geometries containing a single part only a direct reference to that part will be returned.
- For compound curve geometries containing a single curve only a direct reference to that curve will be returned.

This method returns a reference only, and does not involve any geometry cloning.
2021-05-24 10:11:37 +10:00
Nyall Dawson
f21ea8c54a Avoid styleChanged() signals being raised before new labeling
configuration is set when changing a vector layer's style preset

This causes the layer styling dock to update before the layer's
new labeling settings are set, so the dock shows the incorrect
label settings for the previously used style

Fixes #42310
2021-05-22 11:50:02 +10:00
Alessandro Pasotti
d06f1e6467 Fix SIP issue with return results from calculateStatistics
Fixes #43245

SIP failed to convert the QMap<QgsZonalStatistics::Statistic, QVariant>
so we give it an QMap<int, QVariant>.
2021-05-22 07:04:16 +10:00
Nyall Dawson
7bf85a0ccc Disambiguate use of QgsMapCanvas::fullExtent and
QgsMapCanvas::zoomToFullExtent

In 3.18 these methods changed their meaning from the "full extent
of all layers visible in the canvas" to "the full extent of the
associated project".

These are actually two different, equally valid use cases, so
disambiguate by adding new explicit methods projectExtent()
and zoomToProjectExtent(), and revert fullExtent() and
zoomToFullExtent() to their pre-3.18 behavior.

Fixes #43303
2021-05-21 18:12:21 +10:00
Nyall Dawson
dc50988147 Move logic to calculate combined extent of a set of map layers
to new QgsMapLayerUtils class
2021-05-21 18:12:21 +10:00
rldhont
65761a177c QgsMapLayer::ReadFlag::FlagReadExtentFromXml to extend vector layer read capabilities to other layer types
In QgsVectorLayer, it is possible through the flag trust layer metadata to use extent read in XML
instead of extent provided by the provider.

The QgsMapLayer::ReadFlag::FlagReadExtentFromXml can be used inlayer readXML to read Extent from XML for raster, point cloud and other layers.

Funded by Ifremer
2021-05-21 09:12:07 +02:00
nirvn
59a6217c29 Fix compilation on vcpkg 2021-05-21 11:28:55 +07:00
Nyall Dawson
9dda143cc9 Also move QgsMapLayerModel::iconForLayer to QgsIconUtils 2021-05-21 09:22:05 +10:00
Nyall Dawson
06844626d1 Move QgsLayerItem icon related static methods to new QgsIconUtils class
These utilities are used in a LOT of places in QGIS, but the
qgslayeritem.h include is a very heavy dependency. It makes sense
to have these utilities in a nice lightweight generic class.
2021-05-21 09:22:05 +10:00
Nyall Dawson
b5aace6e82 Split qgsdataitem.h/cpp into multiple files for individual classes
to avoid mega file which triggers an include explosion
2021-05-21 09:22:05 +10:00
Nyall Dawson
68c98b55e7 Move core browser and map renderer files to src/core/browser
and src/core/maprenderer subfolders

Helps keep src/core a little more organized
2021-05-21 09:22:05 +10:00
Paulo van Breugel
643b42277a
Update r.clump.txt
Add missing threshold parameter. It sets a threshold to identify similar cells. Floating number, valid range: 0 = identical to < 1 = maximal difference. Default: 0
2021-05-21 08:46:32 +10:00
Nyall Dawson
95c01cc93c Dox, enum class 2021-05-21 08:26:14 +10:00
Nyall Dawson
72a57b271f Add QgsFileUtils::pathIsSlowDevice to determine whether a file path
likely resides on a slow device (eg. a remote network location)
2021-05-21 08:26:14 +10:00
Nyall Dawson
e3061a8f51 Add method to determine the drive type for a file path
Supported on Windows builds only
2021-05-21 08:26:14 +10:00
Nyall Dawson
de406693c7 Move QgsVectorLayerExporter.ExportError to Qgis and promote to enum
class

This avoids an ugly include of qgsvectorlayerexporter.h in
qgsproviderregistry.h/qgsprovidermetadata.h, which in turn
triggers an inclusion of qgsvectorlayer.h and a bunch of
other heavy dependencies.
2021-05-20 21:09:56 +10:00
Nyall Dawson
c543a57b83 Remove some unused widget imports from core library 2021-05-19 13:52:58 +10:00
Nyall Dawson
13e923838a Fix build 2021-05-19 10:16:43 +10:00
Nyall Dawson
581d355e2a Avoid silly doxygen warning 2021-05-19 10:16:43 +10:00
Nyall Dawson
0c4dd068c4 Move generic provider related files to src/core/providers
Minor clean up
2021-05-19 10:16:43 +10:00
Nyall Dawson
7291bbb457 Dox 2021-05-18 16:59:22 +10:00