4650 Commits

Author SHA1 Message Date
Nyall Dawson
cf7714b722 Restore tests, add button to set page background in ui 2017-11-07 11:32:38 +10:00
Nyall Dawson
4a1bcb3266 Revert automatic detection for preview renders
Turns out there's no reliable way to differentiate widget
vs QImage based renders inside QGraphicsItems
2017-11-07 11:32:38 +10:00
Nyall Dawson
edecc37c9f Start work on exporter for layouts 2017-11-07 11:32:38 +10:00
Nyall Dawson
9630a39190 [layouts] Nicer detection of rendering in a view
In compositions, a flag must be explicitly set to indicate
whether the render occuring is for "previews" (i.e.
rendering in a graphics view) or outputs (i.e. rendering
to a image/pdf/other destination device)

This isn't nice api.

So we avoid this by checking the paint device type when
an item is being rendered.
2017-11-07 11:32:38 +10:00
Nyall Dawson
625eef80eb Fix resizing with mouse handles acts strangely when items have frames 2017-11-07 11:32:38 +10:00
Nyall Dawson
8629225a41 Work on functional rotation for items 2017-11-07 11:32:38 +10:00
Nyall Dawson
3678f01e54 Port item opacity handling from composer 2017-11-07 11:32:38 +10:00
Nyall Dawson
75898d8e09 Port 'exclude from exports' functionality from composer 2017-11-07 11:32:38 +10:00
Nyall Dawson
4e8878dcb3 Port item blend mode support to layouts 2017-11-07 11:32:38 +10:00
Nyall Dawson
0143d0be68 Add a signal to QgsLayoutContext when flags change 2017-11-07 11:32:38 +10:00
Nyall Dawson
06650808b5 Fix resize of grouped items with non-top left reference points 2017-11-07 11:32:37 +10:00
Nyall Dawson
ab4e6c11ed Fix resizing items with non-top-left reference point using mouse handles 2017-11-07 11:32:37 +10:00
Nyall Dawson
aebe5a42e6 Allow reseting ratio manually for linked ratio lock buttons 2017-11-07 11:32:37 +10:00
Nyall Dawson
d3836e502a Move population of layout gui registry from GUI->app
Since we don't want all the item type subclass config widgets
to have to reside in gui, we need to populate the registry
from app instead.
2017-11-07 11:32:37 +10:00
Nyall Dawson
ca0c8302a1 Add missing QCoreApplication for TestQgsNoApplication 2017-11-06 10:51:23 +10:00
Nyall Dawson
2eff873e0e Fix crash when accessing QgsApplication::dataItemProviderRegistry()
without QgsApplication instance.

Also add test to ensure that calling QgsApplication::initQgis()
is safe to do without QgsApplication instance.
2017-11-06 10:19:35 +10:00
Nyall Dawson
c413f147bf Fix crash when accessing auth manager when no QgsApplication is available 2017-11-06 10:13:31 +10:00
Nyall Dawson
31f98dac03
Merge pull request #5534 from nyalldawson/format
Add flags to QgsVectorFileWriter methods which return lists of drivers
2017-11-06 08:56:17 +10:00
Matthias Kuhn
394c53154f Update for nose2 0.7.0 2017-11-05 23:03:16 +01:00
Nyall Dawson
8499d7fcef Add option to hide non-spatial formats from driver lists
And hide non-spatial formats from geometry checker available formats
2017-11-06 07:49:31 +10:00
Nyall Dawson
fe0566000e More QPair API removal 2017-11-06 07:34:01 +10:00
Nyall Dawson
a4ef7e42c7 Avoid use of QPair and instead use a struct 2017-11-06 07:22:04 +10:00
Nyall Dawson
d855f7f3f4 Remove redundant '[OGR'] string from dialogs 2017-11-06 07:22:04 +10:00
Nyall Dawson
dc341d2047 Add flags to QgsVectorFileWriter methods which return lists of drivers
Initially only flag available is whether to sort drivers by
recommended order. The recommended order puts GPKG first and
SHP second, then leaves the rest alphabetical.

This fixes a few instances in the QGIS gui where these recommended formats
are not listed first.
2017-11-06 07:22:04 +10:00
Matthias Kuhn
edcaf05bcb Add missing import for test 2017-11-04 10:46:05 +01:00
Nyall Dawson
33d422b4de
Merge pull request #5518 from nyalldawson/interp
Start on unit tests for interpolation classes
2017-11-04 07:10:28 +10:00
Alessandro Pasotti
c9ee3ef3b0 [auth] Tests for Basic method uses trusted CAs 2017-11-03 14:56:21 +01:00
Nyall Dawson
61fa8da82a Start on unit tests for interpolation classes 2017-11-03 17:07:14 +10:00
Nyall Dawson
9083420312 More unit tests 2017-11-01 21:48:20 +11:00
Nyall Dawson
eea155d6e2 Fix crash when attempting to render multipolygon with missing exterior ring
This commit fixes a possible crash when the vector layer renderer
attempts to render a multipolygon containing a polygon without
an exterior ring.

The underlying cause of the creation of this invalid geometry is deeper,
but this commit hardens the renderer and makes it more robust for
handling bad geometries.

Fixes #17365
2017-11-01 21:48:20 +11:00
Nyall Dawson
48d43d37ed
Merge pull request #5497 from nyalldawson/svg_crash
Fix crashes and issues with SVG rendering
2017-11-01 05:21:37 +11:00
Matthias Kuhn
87643e9c8f Harden taskmanager tests
By using local variables and functions interdependency of the tests is decreased
2017-10-31 07:28:09 +01:00
Nyall Dawson
dbe2b340ac Update copyright date 2017-10-31 16:01:33 +10:00
Nyall Dawson
8d32bf729e Fix QgsGraphAnalyzer::dijkstra traverses through edges backwards
This means that it flips the direction of the graph edge, breaking
route restrictions.

Refs #17325
2017-10-31 16:01:32 +10:00
Nyall Dawson
199b569275 Fix broken network analysis network tolerance option
The tolerance option was not correctly calculated, resulting in
semi-random behavior for networks which relied on a non-zero
tolerance.

Also possible speed boost for complex networks by using
proper spatial index instead of custom sorting/filtering code.

Refs #17325
2017-10-31 16:01:32 +10:00
Nyall Dawson
ae8dc1cfb3 Optimise and simplify tie point calculation 2017-10-31 16:00:19 +10:00
Nyall Dawson
ab05fe7603 Fix extremely confusing network graph API naming
Since names of api calls were backwards to expectations
2017-10-31 16:00:19 +10:00
Nyall Dawson
b337335e9c Start unit tests for network analysis lib 2017-10-31 16:00:18 +10:00
Nyall Dawson
0b2de85fe7 Check file modified time when retrieving svg images from cache
If file has been modified since the cache, regenerate a new cache
image.

We don't want to check the file modified time too often though,
(e.g., we don't want to check for every point render in a 100k
point file), so use a hardcoded 30 second minimum time between
consecutive file modified checks.

This means that file modifications occuring more often than
every 30 seconds won't be picked up till 30 seconds has elapsed
since the last modification. But at the same time it means that
if the render takes < 30 seconds we'll only check each svg
at most once (and if a render takes > 30 seconds, adding a few
more milliseconds won't hurt!).

Fixes #13565
2017-10-31 12:12:24 +10:00
Nyall Dawson
a6eea7205c Fix crashes caused by concurrent rendering of cached QPictures from QgsSvgCache
QgsSvgCache::svgAsPicture was rendering an implicitly shared copy when
the picture had already been cached. It turns out that rendering an
implicitly shared QPicture copy isn't thread safe, and rendering shared
copies simulataneously across different threads leads quickly to a crash.

Accordingly we always detach the QPicture objects returned by
svgAsPicture, so that the returned QPicture is safe to use across threads.

Also add unit tests for this, and a similar unit test to verify that
rendering of QImage based cached copies does *not* suffer the same
issue.

Fixes #17089, #17077
2017-10-31 10:24:18 +10:00
Nyall Dawson
942f431f0f Fix crash when rendering with SVG based symbols and SVG cache is filled
When the svg cache was full, any attempt to render an svg from the
cache would crash QGIS.

Fixes #16643
2017-10-30 21:32:48 +10:00
Matthias Kuhn
e0025b65b1
Rename QgsGeometry::fromPoint to QgsGeometry::fromPointXY
Also introduces the from[Geometry]XY for QgsGeometryFactory
2017-10-30 09:14:06 +01:00
Matthias Kuhn
82e6d1219f
Rename from[GeometryType] to from[GeometryType]XY
- QgsGeometry::fromPoint() was renamed to fromPointXY()
- QgsGeometry::fromMultiPoint() was renamed to fromMultiPointXY()
- QgsGeometry::fromMultiPolyline() was renamed to fromMultiPolylineXY()
- QgsGeometry::fromPolygon() was renamed to fromPolygonXY()
- QgsGeometry::fromMultiPolygon() was renamed to fromMultiPolygonXY()
2017-10-30 09:14:06 +01:00
Matthias Kuhn
bde014ec7b
Adjust leftovers addPointsV2 to addPoints 2017-10-30 09:14:06 +01:00
Matthias Kuhn
ca74e391cd
Rename QgsGeometry.addPoints with XY / V2-less versions 2017-10-30 09:14:05 +01:00
Matthias Kuhn
750a54f8f6
More drop V2 suffix fixes 2017-10-30 09:14:05 +01:00
Matthias Kuhn
e19f6482ca
Various fixes to dropping V2 suffix 2017-10-30 09:14:05 +01:00
Matthias Kuhn
7f3ad76882
Rename QgsMultiPolygonV2 to QgsMultiPolygon 2017-10-30 09:14:04 +01:00
Matthias Kuhn
3fcdcd87af
Rename QgsMultiPointV2 to QgsMultiPoint 2017-10-30 09:14:04 +01:00
Matthias Kuhn
b6f46eae11
Rename QgsPolygonV2 to QgsPolygon 2017-10-30 09:14:04 +01:00