Previously QgsSvgCache would often try to fetch remote images
using a network request on the main thread, by calling
processEvents repeatedly until the request was complete.
This caused lots of bugs, since the main thread processEvents
would proceed with all kinds of stuff assuming that the
svg fetch operation was complete, leading to frequent crashes
and deadlocks and making remote svg use impossible (it's
likely that the SVG cache remote fetching code was written
in the pre-multi-threaded rendering era).
There's no way to fix this with async svg fetching - we
HAVE to remove the processEvents call, and a QEventLoop
won't help either (since the method may be called on the
main thread). Accordingly the only solution is to
fetch the requested svg in the background, and return
a temporary "downloading" svg for use in the meantime.
We use a QgsNetworkContentFetcherTask to do this, so it's
nicely integrated with task manager.
A request task is fired up when a remote svg is requested
for the first time, with the temporary downloading svg
returned for use by the caller asynchronously. QgsSvgCache
then emits the remoteSvgFetched signal when a previously
requested remote SVG has been successfully fetched,
triggering a map canvas redraw with the correct SVG
graphic.
Fixes#18504
Aside from the performance benefits, the Python version of this
algorithm occasionally fails on Travis with odd errors. Hopefully
by porting to c++ it will fix these, or at least give useful
debug information in the event of a fail.
Also add support for curved input geometries.
Used for new-style Qt connects to overloaded signals,
avoiding the usual horrible connect syntax required in
these circumstances.
Example usage:
connect( mSpinBox, qgis::overload< int >::of( &QSpinBox::valueChanged ),
this, &MyClass::mySlot );
This is an alternative to qOverload, which was implemented in Qt 5.7.
See https://stackoverflow.com/a/16795664/1861260
- Output interpolated points when travel cost falls mid-way along
an edge
- Output all intermediate reachable points also
- Make outputting upper/lower bound points optional, and non-default.
Now by default we just output all definitely reachable points and
the interpolated points along edges which correspond to the travel cost.
This allows the output to be used to correctly generate service areas
e.g. by concave/convex polygons and all reachable nodes will be
included in the area.
- Allow algorithm to optionally output a line layer (and make the
point layer optional too, and default to just the line layer output)
containing all reachable line segments (including interpolated
segments of lines when the travel cost sits midway along that
edge). This output is more easily understandably for users.
Type "bored" into the coordinates box (best results with a map loaded in canvas)
Click on tiles to move them to the empty space.
Click on the empty tile to toggle tile numbers.
Returns a copy of the geometry with the x and y coordinates
swapped. Useful for repairing geometries which have had their
latitude and longitude values reversed.
This algorithm swaps the X and Y coordinate values in input
geometries. It can be used to repair geometries which have
accidentally had their latitude and longitude values reversed.