5918 Commits

Author SHA1 Message Date
Nyall Dawson
afac0312aa Expose QgsGeos class to PyQGIS
This class has lots of (very useful!) GEOS specific functionality which
is not exposed through the base QgsGeometryEngine class
2024-12-06 19:20:26 +10:00
Denis Rouzaud
76f702e48a sipify 2024-12-05 13:19:50 +01:00
Nyall Dawson
2140c555fe Double-clicking a mouse handle for a layout label resizes to fit text
Double-clicking a handle will auto-size the label to exactly fit
the contained text (growing or shrinking as needed). The opposite
side of the label will remaining fixed in place, so eg double-click
the bottom-right handle causes the bottom-right corner of the label
to move.
2024-12-05 05:13:53 +10:00
Nyall Dawson
87efed6b0e Expose mode 2024-12-04 02:57:51 +10:00
David Koňařík
d47ad7dfe0 Minor changes per review 2024-12-03 09:26:55 +01:00
David Koňařík
f2afd6a498 Expose point cloud class statistics to Python 2024-12-03 09:26:55 +01:00
David Koňařík
e5064f092a Refactor QgsPointCloudIndex statistics methods 2024-12-03 09:26:55 +01:00
hxbb00
33b22c6519 feat: Enhance the ability to customize icons for QgsPluginLayer 2024-12-03 12:58:00 +10:00
Nyall Dawson
37478db0c1 Fix more function links 2024-12-03 12:57:44 +10:00
Nyall Dawson
d50fe2a9e5 Fix function links, sipify 2024-12-03 12:57:44 +10:00
Nyall Dawson
8d60d4f6d7 Make some factories return unique_ptr 2024-12-03 07:06:02 +10:00
Nyall Dawson
7670fbe362
Move class, method out of QgsPalLabeling to central location 2024-12-02 12:46:23 +10:00
Nyall Dawson
bb6919aeea Move QgsRasterMinMaxOrigin enums to Qgis, promote to enum class 2024-11-30 07:36:47 +10:00
Jean Felder
9d372b6019 qgsrasterlayer: Remove refresh logic
This is not used anymore.
2024-11-28 14:37:06 +10:00
Jean Felder
76cbf8b3a5 qgsrasterlayer: Make computeMinMax public
This will be used in the next commit to refresh a renderer.
2024-11-28 14:37:06 +10:00
Jean Felder
dd36eb7249 qgsrasterrenderer: Introduce refresh
This is similar to what is achieved in
`QgsRasterLayer::refreshRenderer()` to refresh the renderer according
to an extent. Contrary to the first one, this method does not perform
any GUI update or emit any signal.

It is not used at the moment. This will replace the logic to refresh a
renderer in the following commits.
2024-11-28 14:37:06 +10:00
Jean Felder
2747710499 qgsrasterrenderer: Introduce needsRefresh
This is similar to what is achieved in
`QgsRasterLayer::refreshRendererIfNeeded()` to check if the renderer
needs to be refresh according to an extent. It does not perform any
refresh.

It is not used at the moment. This will replace the logic to refresh a
renderer in the following commits.
2024-11-28 14:37:06 +10:00
Jean Felder
efaff7e2f5 introduce qgsrenderedlayerstatistics
This will be used in the next commits to store the min-max values of a
raster layer and report them to the main canvas.
2024-11-28 14:37:06 +10:00
Yoann Quenach de Quivillic
32c6a3d8e7 Add global enum 2024-11-27 07:10:29 +10:00
Nyall Dawson
6b468bc32d
Add != operator for QgsColorRampShader 2024-11-26 15:04:03 +10:00
Mathieu Pellerin
cbef4f7172 [qml] Upgrade QgsRectangle to Q_GADGET 2024-11-25 10:26:38 +10:00
Mathieu Pellerin
3ec4a8aab3 [qml] Expose QgsLocatorContext's transformContext as property 2024-11-25 10:26:38 +10:00
Nyall Dawson
e82b375ed0 Revert "[qml] Upgrade QgsRectangle to Q_GADGET"
This reverts commit 657d3d3190417fc1578f53559fd5133cf07f5199.
2024-11-23 09:01:05 +10:00
Nyall Dawson
9a537b71e9 Revert "[qml] Expose QgsLocatorContext's transformContext as property"
This reverts commit 714ddff73991730d4ea4b063a09ed800d2623d19.
2024-11-23 09:01:05 +10:00
Mathieu Pellerin
714ddff739 [qml] Expose QgsLocatorContext's transformContext as property 2024-11-22 17:35:55 +07:00
Mathieu Pellerin
657d3d3190 [qml] Upgrade QgsRectangle to Q_GADGET 2024-11-22 17:35:55 +07:00
Nyall Dawson
6708501ee9 [feature] Support CSS background property in labels/text renderer
This commit adds support for the CSS ``background-color`` and
``background-image`` properties when used with HTML labels.

- Backgrounds are supported for block items (eg ``<div>``) or inline
  items (eg ``<span>``)
- For images, the CSS should be formatted as ``background-image: url(xx)``.
  It supports local file paths, http links, or base64 embedded content
- Backgrounds are not supported for curved text
- HTML backgrounds are always rendered above any background shape for
  the label, and below drop shadows/buffers

Sponsored by City of Freiburg im Breisgau
2024-11-22 05:59:44 +10:00
Nyall Dawson
dd84aab200 Add background brush property for QgsTextBlock, QgsTextFragment 2024-11-22 05:59:44 +10:00
Mathieu Pellerin
7d190f9171
[qml] Upgrade QgsLocatorResult to a Q_GADGET (#59547) 2024-11-21 15:03:52 +01:00
Mathieu Pellerin
10883253d3 [qml] Upgrade QgsLocatorContext to a Q_GADGET 2024-11-20 21:02:31 +07:00
Nyall Dawson
2abc9d92ca [sld] Don't try to write rules/categorizes without symbolizers
Only create rules/categorized categories/graduated ranges if the
associated symbol could be converted to SLD, and is not an "empty"
symbol.

Otherwise we do not generate a rule, as SLD spec requires a
Symbolizer element to be present.
2024-11-19 21:06:26 +10:00
Nyall Dawson
f446bda82a [optimisation] Greatly speed up clone of QgsSvgMarkerSymbolLayer
The old method was very inefficient, as it required a re-load and
re-parse of the associated SVG file content with every clone, only
for many of the parsed properties to be immediately overwritten.

Optimise by just directly copying members, avoiding all unnecessary
work.

This is frequently seen as a hotspot when profiling map renders,
as that involves cloning all symbol layers upfront.

Speeds up a benchtest cloning 100k markers from 4.3 seconds to
150ms.
2024-11-19 12:40:44 +10:00
Nyall Dawson
7a17557e64 Refactor QgsTextRenderer internal methods, optimise buffer render
Rework internals of QgsTextRenderer horizontal text rendering,
so that:

1. It's easier to read, cleaning up years of accumulated cruft
2. Split out bits into smaller functions
3. Reduce the amount of duplicate code for text layout, so that
there's only one function responsible for horizontal text layout
instead of multiple
4. Add shortcut optimisations for rendering text + buffer/shadow
at the same time, instead of always drawing these completely
independantly of each other and incurring the cost of text path
calculation multiple times for the same bit of text. In a simple
benchtest this reduces the time required for rendering many
text fragments with buffers from 40 seconds to 27 seconds.

There's still more we could do here, but it's a start...
2024-11-19 11:15:34 +10:00
Harrissou Sant-anna
6648c9596c s/if/whether 2024-11-16 07:28:29 +10:00
Harrissou Sant-anna
ac3c06d3ad Rewording and formatting in PyQGIS docs 2024-11-16 07:28:29 +10:00
Denis Rouzaud
3e085e496b move read/write XML for QgsMapThemeCollection::MapThemeRecord inside class 2024-11-16 07:24:58 +10:00
Yoann Quenach de Quivillic
b2f3876e38 Apply suggestions from review 2024-11-14 09:54:48 +10:00
Nyall Dawson
2889aa375b Fix use-after-free 2024-11-12 08:49:18 +01:00
Nyall Dawson
3e1c84e07e Finalize sinks to get proper error reporting when flushing features
Fixes #59237
2024-11-12 08:49:18 +01:00
Nyall Dawson
20405003aa QgsProxyFeatureSink should forward flushBuffer to underlying sink 2024-11-12 08:49:18 +01:00
Nyall Dawson
656eb4ccc6 Add AllNumeric value, QGIS 4.0 todo note 2024-11-11 13:01:42 +10:00
Nyall Dawson
2890df089d [feature] Add raster zonal min/max algorithm
This algorithm extracts point features corresponding to the minimum
and maximum pixel values contained within polygon zones.

The output will contain one point feature for the minimum and one
for the maximum raster value for every individual zonal feature
from a polygon layer.
2024-11-11 13:01:42 +10:00
Nyall Dawson
7badf62596 [api] Add tab positions list for QgsTextFormat
Allows setting a list of custom tab stop distances, instead
of just a single distance
2024-11-10 09:52:14 +11:00
Nyall Dawson
0cccf4c42b Support CSS margins for block elements in HTML labels
Adds support for CSS margin properties for block elements in
the text renderer. Specifically:

- This is available for block type elements only, eg DIV, P, H1-H6.
- Margins are NOT available for spans or other non-block content (due to Qt
  limitations)
- Margins can be specified in pt units only
- Margins can be specified either via "margin-left: 5pt; margin-right:
  10pt" etc, or "margin: 5pt 0pt 10pt 0pt"
- Negative margins are supported for the bottom margin ONLY (due to Qt
  limitations)
2024-11-10 09:51:55 +11:00
Nyall Dawson
5a7fbaac1b Convert block margins to QgsTextBlockFormat margins 2024-11-10 09:51:55 +11:00
Nyall Dawson
e9a51d6806 Add repr for QgsMargins 2024-11-10 09:51:55 +11:00
Martin Dobias
5a6b07e22a Nyall's review 2024-11-08 12:44:27 +01:00
Martin Dobias
13251c2bf1 Make tessellator not flip axes and use the new option in QGIS code
We add a new setOutputZUp(true) option to QgsTessellator so that
the coordinates on output do not get flipped from [x,y,z] to [x,-z,y].

The default is still the old behavior with flipped axes (to make sure
we do not break the API), but all uses in the QGIS code were upgraded
to use the new option.

This means we do not need to add rotation to polygon / buffered line
symbol's 3D entities in 3D map views (and there's only translation left, yay!)
2024-11-08 12:44:27 +01:00
Nyall Dawson
ace375b686 Move raster iteration progress calculation to raster iterator class 2024-11-07 10:13:55 +11:00
Juho Ervasti
47b812bb9b
Don't allow non-polygon avoid intersection layers (#59331) 2024-11-05 06:41:56 +01:00