266 Commits

Author SHA1 Message Date
Nyall Dawson
4ff3f447dc Don't try to insert links in raises blocks in PyQGIS docs
These aren't formatted correctly if we do
2021-06-10 11:03:43 +10:00
Nyall Dawson
8359281012 Fix formatting of exception blocks in PyQGIS docs 2021-06-10 11:03:43 +10:00
Nyall Dawson
4e73dd92b9 Fix accidental api break
QFlags created from enum classes aren't automatically converted
from an int value passed by Python code, so we need to create
compatibility functions for the older variants which accept
plain ints
2021-05-30 09:27:41 +10: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
Nyall Dawson
c3e01e5725 Add destructors to permit forward declaration 2021-05-26 08:14:13 +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
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
nirvn
59a6217c29 Fix compilation on vcpkg 2021-05-21 11:28:55 +07: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
7291bbb457 Dox 2021-05-18 16:59:22 +10:00
Nyall Dawson
b5dfe8f155 Refactor enum handling
- Add enums to qgis.h instead of qgscoreenums, so that they belong to
a Qgis namespace
- Split up the various symbol headers into multiple files so that we
can fine-tune their inclusion and forward declare more readily, speeding
up recompilation
- Move QgsSymbol enums to qgis
2021-05-18 16:59:22 +10:00
Nyall Dawson
94dc209e9e Add dedicated conversion for MapInfo marker symbols 2021-05-10 15:18:01 +10:00
Nyall Dawson
2c75fd0ca1 Sipify 2021-05-07 19:48:19 +10:00
Nyall Dawson
1a4d7b0288 Improved conversion of MapInfo line symbols
Many MapInfo line symbols don't translate well into OGR styles, so
in order to improve the quality of the conversion this commit introduces
a new QgsMapInfoSymbolConverter class which contains utility functions
for converting MapInfo symbols by ID to their QGIS equivalent.

Implemented for line symbols only for now.
2021-05-07 06:38:09 +10:00
Nyall Dawson
be2c5382cb Add utility function QgsSymbolLayerUtils::condenseFillAndOutline
Attempts to condense a fill and outline layer, by moving the
outline layer to the fill symbol's stroke if possible.
2021-05-06 18:23:09 +10:00
vcloarec
89c069f695 address review 2021-05-05 09:03:13 +02:00
vcloarec
843eebc6ec do not use hybrid symbol layer type 2021-05-05 09:03:13 +02:00
vcloarec
9a3ad85533 interpolated line symbol layer 2021-05-05 09:03:13 +02:00
Nyall Dawson
3c06b6d425 If a text format with the name "Default" is found in the style database,
use this as the text format for newly created layer labels

Instead of defaulting to a random font, this gives us a mechanism
to supply a better default label font to users via the default
style database. And users can always modify this "default" text
format if they'd like to change the default font!

For now this is the underlying code logic changes only -- we
don't yet include a 'Default' text format in the default style database
to take advantage of this functionality.
2021-04-29 14:45:09 +10:00
Nyall Dawson
ce5558ee05 QgsSymbol::start/stopFeatureRender needs to be public so python subclasses can call it 2021-03-31 18:28:25 +10:00
Matthias Kuhn
6ca82a2717 Fix sipify 2021-03-28 06:29:24 +10:00
Matthias Kuhn
10e9de15e8 [qt6] compatibility with [[deprecated]] attribute 2021-03-28 06:29:24 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
nirvn
ad998573d4 [optimization][symbology] Rely on enum for ellipse marker symbol layer shapes 2021-03-19 07:59:27 +07:00
nirvn
6d64fabe07 [ui] Disable fill color for stroke-only ellipse symbols 2021-03-18 10:15:08 +07:00
Nyall Dawson
e8280d29bc More see also fixes 2021-03-18 11:43:00 +10:00
Nyall Dawson
b3b89733a8 Fix see also links 2021-03-18 11:43:00 +10:00
Nyall Dawson
a16ab723d5 [feature] Add option to trim the start and end of simple line symbol
layers by a preset amount

This allows for the line rendering to trim off the first x mm
and last y mm from the actual line string when drawing the line.
It can be used eg when creating complex symbols where a line layer
should not overlap marker symbol layers placed at the start
and end of the line.

The start/end trim distance supports a range of units, including
percentage of the overall line length, and can be data defined
for extra control.
2021-03-18 11:43:00 +10:00
Nyall Dawson
99c5ac3d66 Add method to calculate total length of a QPolygonF line 2021-03-18 11:43:00 +10:00
nirvn
2cbb1307cb Address review 2021-03-17 16:14:07 +07:00
nirvn
01f1f0c78a [symbology] Add a semi arc and arrow sign to ellipse markers 2021-03-17 15:52:55 +07:00
nirvn
b3d27aacce [symbology] Add a 1/2, 1/3, 1/4 arc signs to simple markers 2021-03-17 15:52:44 +07:00
Mathieu Pellerin
09620ad7db
[feature][symbology] Allow pen cap style to be set for ellipse marker symbol layers (#42289) 2021-03-17 15:22:49 +07:00
Nyall Dawson
109f95b3cd [feature] Allow pen cap style to be set for simple marker symbol layers
This is useful for the stroke-only symbols like the cross and arrowhead
markers, where it's sometimes nice to have round caps instead of square
caps.
2021-03-17 14:53:18 +10:00
Nyall Dawson
e87e6720ec Impove dox 2021-03-06 16:37:46 +10:00
Nyall Dawson
5245430461 Add widget for Embedded Symbols renderer
Allows users to control the default symbol used for features without
embedded styles
2021-03-06 16:37:46 +10:00
Nyall Dawson
8845a7688a Allow conversion of embedded renderer to rule based renderers 2021-03-06 16:37:46 +10:00
Nyall Dawson
b4b5162344 Support conversion of embedded symbol renderer to categorized renderer 2021-03-06 16:37:46 +10:00
Nyall Dawson
6e6bcfd8bd Add default symbol property for embedded symbol renderer
Used as a fallback symbol for features without embedded symbology
2021-03-06 16:37:46 +10:00
Nyall Dawson
50082a396f Create new "Embedded Symbol" renderer
This renderer will draw features using their embedded feature symbology
2021-03-06 16:37:46 +10:00
Nyall Dawson
f32d563041 Add virtual method QgsFeatureRenderer::usesEmbeddedSymbols()
Should return true for feature renderers which require embedded
feature symbology. The corresponding feature request flag will
be set on the iterator used for the renderer will rendering vector
layers.
2021-03-06 16:37:46 +10:00
Nyall Dawson
ef147599df Add some helpful utility functions to QgsSymbol 2021-03-06 16:37:46 +10:00
Nyall Dawson
c6370c7f52
Speed up QGIS compilation by removing all Qt Module-wide includes
Refs https://www.kdab.com/beware-of-qt-module-wide-includes/
2021-03-05 11:23:15 +10:00
Alessandro Pasotti
7b2fc4c1f8 More doxy nonsense, pt 2 2021-02-19 08:15:29 +10:00
Nyall Dawson
22a4b881d3 Sipify 2021-02-12 15:41:14 +10:00
Nyall Dawson
980d9697a0 Simple line can cause tile artifacts if it's a dashed line 2021-02-12 15:41:14 +10:00
Nyall Dawson
f75c53bbd8 Add QgsSymbol::canCauseArtifactsBetweenAdjacentTiles()
Returns True if ANY of the symbol layers contained in the symbol
can cause tile rendering artifacts
2021-02-12 15:41:14 +10:00
Nyall Dawson
bdf5e4fe3b Add QgsSymbolLayer::canCauseArtifactsBetweenAdjacentTiles()
Returns true if the symbol layer rendering can cause visible
artifacts across a single feature when the feature is rendered
as a series of adjacent map tiles each containing a portion
of the feature's geometry.

This depends on the symbol layer derived class itself - eg
a simple solid color fill won't show any artifacts, but a shapeburst
fill WILL.
2021-02-12 15:41:14 +10:00