476 Commits

Author SHA1 Message Date
Nyall Dawson
d5511a50d8 [feature] Allow end point marker symbols for balloon callout style
Allows rendering a marker symbol below the endpoint of the balloon
callout. Designed to allow balloon callouts to reproduce the same
visual appearance as the older annotation framework items.
2024-08-15 06:25:24 +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
Till Frankenbach
93770eca37
Add Method to Convert QgsRasterBlock to NumPy Array (#58232) 2024-08-14 10:16:40 +02:00
Nyall Dawson
dc68f03f88 Be tolerant against optional sip modules 2024-08-14 13:05:46 +10:00
Nyall Dawson
8b04562ba7 Avoid fragile reg for argument removal 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
qgis-bot
a3751f5196 auto sipify 🍺 2024-08-13 11:56:33 +00:00
Nyall Dawson
182e30ab61 Simplify regex to avoid catastrophic backtracking 2024-08-13 20:28:55 +10:00
Nyall Dawson
3a578d6712 Header update 2024-08-13 20:28:55 +10:00
Nyall Dawson
e7b26478e2 Valid fixes 2024-08-13 20:28:55 +10:00
Nyall Dawson
63e81d8caf Valid improvement 2024-08-13 20:28:55 +10:00
Nyall Dawson
be8dce7d0d Valid improvements from new sipify 2024-08-13 20:28:55 +10:00
Nyall Dawson
886074c913 Rename 'None' enum members in public API
These clash with the Python bindings, where the enum value
becomes unusable
2024-08-06 19:49:10 +10:00
Nyall Dawson
5b084d39f4 Add documentation 2024-08-06 13:30:16 +10:00
Nyall Dawson
547387037f [annotations] Add support for callouts to point text item
Allows creating of callout lines (or bubble callouts) which
link the text to a map location. To create a callout, users
select the text item and then drag out the central x node
to the desired callout end point.

Callout styles can be modified through the layer styling panel.
2024-08-06 13:30:16 +10:00
Nyall Dawson
00412a41d3 [annotations] Add linked layer option for annotation layers
Adds a new "Linked layer" setting to the render page for annotation
layers, which allows users to optionally set a linked visibility
layer for the annotation layer. If set, then the annotations will
only be drawn when the linked layer is visible in the map.

This is designed to mimic the similar linked layer option for
the older annotation framework, in order to close the feature
gap between old vs new annotations

Refs https://github.com/qgis/QGIS-Enhancement-Proposals/issues/269
2024-08-03 06:40:03 +10:00
Nyall Dawson
627263ec0f Implement widget for symbol buffer settings 2024-08-02 05:09:03 +10:00
Nyall Dawson
efd700b9e1 Move geometry to QPolygonF list function to common static method 2024-08-02 05:09:03 +10:00
Nyall Dawson
b5437eef50 Add fill symbol for symbol buffers 2024-08-02 05:09:03 +10:00
Nyall Dawson
13c1a1b997 Force vector rendering of symbols when symbol has buffer enabled 2024-08-02 05:09:03 +10:00
Nyall Dawson
c6c3c77303 Populate buffer settings 2024-08-02 05:09:03 +10:00
Nyall Dawson
bf30f04d0a Make common function for copying QgsSymbol properties
Avoid fragile duplicate code in subclasses
2024-08-02 05:09:03 +10:00
qgis-bot
c551352cdf auto sipify 🍺 2024-07-30 22:01:08 +00:00
Nyall Dawson
bae23c28a3 [FEATURE] Text inside rectangle annotation item
This adds a new annotation item type for rendering paragraphs
of text inside a rectangle

Options are present for:

- Text format
- Horizontal and vertical alignment
- Margins
- Background and frame symbol
2024-07-31 07:58:53 +10:00
David Koňařík
654b8bb985 Fix doc comments to align with code
The only previously implemented provider of these classes (for Cesium 3D
tiles) used values directly from the tiles, which are in meters per
spec.
2024-07-29 12:05:12 +02:00
qgis-bot
527c9eff1a auto sipify 🍺 2024-07-29 03:22:40 +00:00
Nyall Dawson
4a247373f0 [api] Split tolerance into separate values for red, green, blue channels
Makes the API more flexible for future use. We only expose a single
tolerance value in the UI, but in future we could expose the
separate tolerances if desired (but be wary of UI bloat!!)
2024-07-29 13:20:21 +10:00
Nyall Dawson
15128498e1 [feature] Support tolerances for QgsRasterTransparency pixel values
Allows pixels with color components just outside of the specified
RGB values to also be treated as transparent pixels

Useful for photographs or compressed rasters where a range of color
values must be made transparent
2024-07-29 13:20:21 +10:00
qgis-bot
4c4317f98b auto sipify 🍺 2024-07-29 02:17:00 +00:00
Even Rouault
d2272306f5 QgsBlockingNetworkRequest::get(): add an optional flag parameter 2024-07-29 12:14:29 +10:00
qgis-bot
5f6debbb6d auto sipify 🍺 2024-07-26 10:41:04 +00:00
Nyall Dawson
6ab373284c Fix merge 2024-07-26 20:38:47 +10:00
Nyall Dawson
0c230a83e7 Add fixed size mode for picture annotations
When selected, the picture annotation will always be rendered
at the same size, regardless of the map scale
2024-07-26 20:38:47 +10:00
Nyall Dawson
75cca8a20c [FEATURE] Add picture annotation item type
Can render SVG or raster images as items in an annotation layer.
Options are present for:

- Locking the picture's aspect ratio
- Drawing with a background symbol
- Drawing with a border symbol
- Linked or embedded pictures
2024-07-26 20:38:47 +10:00
qgis-bot
7894ff43b0 auto sipify 🍺 2024-07-25 22:53:39 +00:00
Nyall Dawson
390d59d6e3 Make current item bounds available for annotation edit operations 2024-07-26 08:51:25 +10:00
Nyall Dawson
80e77a68c5 Add context argument to annotation item edit methods
And deprecate existing ones
2024-07-26 08:51:25 +10:00
qgis-bot
3aed037ce2 auto sipify 🍺 2024-07-25 08:00:08 +00:00
Nyall Dawson
c2c75f3b19
More no-value dox removal 2024-07-25 09:04:22 +10:00
qgis-bot
15fe04a289 auto sipify 🍺 2024-07-24 18:05:14 +00:00
Nyall Dawson
6d829ff7b4 Drop some more no value documentation 2024-07-25 04:02:55 +10:00
Nyall Dawson
6f652d251b Drop no-value copy constructor dox 2024-07-25 04:02:55 +10:00
Nyall Dawson
ad29a505e1 Fix text wrapping stability for small text
Adjust the QgsTextRenderer::calculateScaleFactorForFormat logic
so that small text is scaled up to at least 50 pixels when
calculating text metrics

This avoids tiny differences in calculated text metrics for small
text from affecting how text wrapping is calculated, which can
otherwise result in words at the end of lines "bouncing" from line
to line as layouts and maps are zoomed out
2024-07-25 04:02:33 +10:00
qgis-bot
49a7e85a74 auto sipify 🍺 2024-07-23 06:43:14 +00:00
Nyall Dawson
2fb85192aa Fix crash when extracting symbols from project with layout legend
Legend must be initialized before calling style visitor function

Fixes #57609
2024-07-23 16:40:47 +10:00
qgis-bot
612afa779a auto sipify 🍺 2024-07-22 16:10:48 +00:00
Nyall Dawson
28943f9c1b Remove a bunch of useless default constructor doxygen 2024-07-23 02:08:28 +10:00
Nyall Dawson
bef93c5529 Fix incorrect docs 2024-07-22 07:14:34 +10:00
Nyall Dawson
51b747efce Make API more flexible, allow any layer type for callout widget functions 2024-07-22 07:14:23 +10:00
qgis-bot
d69b60ba77 auto sipify 🍺 2024-07-18 20:15:37 +00:00