246 Commits

Author SHA1 Message Date
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
Nyall Dawson
c582967b6e Add "octagon", "asterisk" and "square with corners" shapes to simple marker
available shapes
2021-02-11 16:01:50 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Denis Rouzaud
6061030f96
enable dynamic SVGs for fill symbol (#40902) 2021-01-08 12:02:31 +01:00
Denis Rouzaud
98d1be22f2 also update usedAttributes with attributes used in SVG parameters 2021-01-06 16:59:54 +01:00
Denis Rouzaud
130cbae947 prepare expressions of properties for SVG parameters 2021-01-06 16:59:54 +01:00
Denis Rouzaud
3881c81184 fix bad rebase 2021-01-06 16:33:23 +01:00
Denis Rouzaud
2e90da4b26 drop QgsSymbolLayerUitls::readSerializedProperties and serializeProperties 2021-01-06 16:11:14 +01:00
Denis Rouzaud
3201fa4ecb use QgsProperty to handle SVG parameters 2021-01-06 11:25:21 +01:00
Denis Rouzaud
9116a1a181 add a simple class to hold parameters information
this makes it more futureproof to introduce type (string/number) or domain (attribute vs node value)
2021-01-06 11:25:21 +01:00
Denis Rouzaud
9c0ee358ff core part to handle dynamic SVGs
this allow to use a map of parameters to dynamically replace attributes or nodes values in the XML of the SVG
2021-01-06 11:25:17 +01:00
Denis Rouzaud
fd7406cb08
Merge pull request #40716 from 3nids/qvariant-properties
use QVariantMap instead of QgsStringMap for symbol layer properties
2021-01-06 11:21:41 +01:00
Nyall Dawson
3ca2137f82 Improve QgsSvgCache documentation, add note about origin of QPictures
returned by svgAsPicture
2021-01-06 09:02:53 +10:00
Nyall Dawson
72065310f5 Dox++ 2021-01-04 13:52:18 +10:00
Nyall Dawson
16c4bead0c Fix dox warning 2021-01-04 13:52:18 +10:00
Nyall Dawson
7fba697bf3 [FEATURE] New "Merged feature" renderer for polygon and line layers
This renderer merges (or unions/dissolves) the line or polygon features
from a layer prior to rendering them. It's useful for rendering
a polygon layer with overlapping features as one single "coverage" feature,
or a line layer consisting of many smaller component line features
using a regularly spaced marker line or similar.

Internally, this just moves the guts of the existing inverted polygons
renderer to a new base class, as that renderer already had an option
to merge features prior to rendering. Basically it just exposes a new
renderer to users which is the inverted polygon renderer without
the inversion step!
2021-01-04 13:52:18 +10:00
Denis Rouzaud
0cae2bea6a add missing doxymentation 2021-01-03 20:33:27 +01:00
Denis Rouzaud
eb46defa6c fix bindings 2021-01-03 20:16:56 +01:00
Denis Rouzaud
2cc632ee5d follow up QVariant 2021-01-03 20:16:56 +01:00
Denis Rouzaud
f77bb217e2 use QVariantMap instead of QgsStringMap for symbol layer properties 2021-01-03 20:16:56 +01:00
Nyall Dawson
39560eaab2 Add interface class for objects which can generate a feature renderer for vector layers 2020-12-28 04:21:04 +10:00