This adds a new "Project Colors" section in data defined buttons
which are linked to a color value. The color menu contains all
colors defined as part of the current project's Project Color
Scheme (which is defined through project properties).
When a project color is selected from the button, the property
becomes linked to that color. It will automatically follow any
future changes to the color when made through project properties.
This allows users to define common colors for a project once,
and then "bind" symbol, label, layout, etc colors to these
preset colors. The link is live, so you change it once, and
the change is reflected EVERYWHERE. Sure beats updating a color
100 times when it's use has been scattered throughout a project's
symbols, labels, etc...
(Basically, this is just adding a shortcut to setting a data
defined expression "project_color(...)" for the property. The
project_color function has been around a LOOONG time, but it's
only really been usable by power users before this change)
and asMultiPolygon()
- raise ValueError when these methods are called with null geometries
- raise TypeError when these methods are called with incompatible
geometry types, instead of silently returning empty lists
This allows nice and simple, elegant construction of checks for
Python.
To use, Python based checks should use the decorator syntax:
from qgis.core import check
@check.register(type=QgsAbstractValidityCheck.TypeLayoutCheck)
def my_layout_check(context, feedback):
results = ...
return results
Or, a more complete example. This one throws a warning when attempting
to export a layout with a map item set to the Web Mercator projection:
@check.register(type=QgsAbstractValidityCheck.TypeLayoutCheck)
def layout_map_crs_choice_check(context, feedback):
layout = context.layout
results = []
for i in layout.items():
if isinstance(i, QgsLayoutItemMap) and i.crs().authid() == 'EPSG:3857':
res = QgsValidityCheckResult()
res.type = QgsValidityCheckResult.Warning
res.title='Map projection is misleading'
res.detailedDescription='The projection for the map item {} is set to <i>Web Mercator (EPSG:3857)</i> which misrepresents areas and shapes. Consider using an appropriate local projection instead.'.format(i.displayName())
results.append(res)
return results
The URL exposed in the XML documents generated
by the server was wrong because instead of
using the original URL (from REQUEST_URI)
the rewritten query string (from QUERY_STRING)
was applied to the internal mUrl variable.
This patch also adds some tests for the
FCGI request, that handle most common
scenarios with bot rewritten and not
rewritten URLs.
QgsFcgiServerRequest is now exposed to
Python mainly for testability purposes.