14360 Commits

Author SHA1 Message Date
Matthias Kuhn
525a3da3ab
More doxygen 2018-12-22 10:57:53 +01:00
Matthias Kuhn
07ab092fb1
Some doc fixes 2018-12-22 10:35:30 +01:00
Matthias Kuhn
65f6e7ba5d
Doxymenation for gap checks 2018-12-22 10:03:22 +01:00
nirvn
9200f538e9 Don't hard-code black and gray for layer tree items' text color 2018-12-21 21:13:19 +07:00
Nyall Dawson
9df3eb3e5c Dox++ 2018-12-21 09:15:32 +10:00
Nyall Dawson
d1a1d7570e QgsBlockingNetworkRequest: Allow canceling via QgsFeedback 2018-12-21 09:05:45 +10:00
Nyall Dawson
a457482de8 Add attributes to QgsNetworkReplyContent 2018-12-21 09:05:45 +10:00
Nyall Dawson
1774e68f39 [FEATURE][API] New class for blocking (non-async) network requests
This new class, QgsBlockingNetworkRequest, is designed for
performing SAFE blocking requests. It is thread safe and
has full support for QGIS proxy and authentication settings.

This class should be used whenever a blocking network
request is required. Unlike implementations
which rely on QApplication::processEvents() or creation of a
QEventLoop, this class is completely
thread safe and can be used on either the main thread or
background threads without issue.

Redirects are automatically handled by the class.

After completion of a request, the reply content should be
retrieved by calling getReplyContent().
This method returns a QgsNetworkReplyContent container,
which is safe and cheap to copy and pass
between threads without issue.

The guts of this class have been copied from QgsWfsRequest (which
has been using the same approach since 3.2)
2018-12-21 09:05:45 +10:00
Nyall Dawson
e4959a6b9a New class QgsNetworkReplyContent
Encapsulates a network reply within a container which
is inexpensive to copy and safe to pass around between threads.
The default Qt QNetworkReply class is a QObject, which prevents
it from being copied and passed between threads. This class
grabs all the useful information from a QNetworkReply,
allowing the reply's content to be stored indefinetly without
concern for the lifetime of the QNetworkReply object itself.
2018-12-21 09:05:45 +10:00
Nyall Dawson
a2b5008b30 [FEATURE][layouts] Allow layout items to "block" map labels
This feature allows other layout items (such as scalebars,
north arrows, inset maps, etc) to be marked as a blockers for
the map labels in a map item. This prevents any map labels from
being placed under those items - causing the labeling engine
to either try alternative placement for these labels (or
discarding them altogether)

This allows for more cartographically pleasing maps -- placing
labels under other items can make them hard to read, yet without
this new setting it's non-trivial to get QGIS to avoid placing
the labels in these obscured areas.

The blocking items are set through a map item's properties, under
the label settings panel. The setting is per-map item, so you can have
a scalebar block the labels for one map in your layout and not others
(if you so desire!)
2018-12-21 04:12:32 +10:00
Peter Petrik
9ce7e54fb1
allow selection of file paths for mesh layers [processings] (#8702)
allow selection of file paths for mesh layers
2018-12-20 15:04:02 +01:00
Nyall Dawson
dab069e1ea Improve multiline cursor behavior in Python console and expression editor
Now supports multi-line inserts and pastes
2018-12-20 17:23:52 +10:00
Denis Rouzaud
166e952c33 run sipify 2018-12-19 08:04:27 -04:00
Denis Rouzaud
6bb0720bb7
Merge pull request #8708 from 3nids/sipify_sip_out
[sipify] handles SIP_OUT arguments
2018-12-18 22:08:42 -04:00
Denis Rouzaud
c20b5b2f75 fix multine removal for SIP_PYARGREOMVEq 2018-12-18 21:54:38 -04:00
Denis Rouzaud
32e844f9f8 fix multiline comments on out params 2018-12-18 17:29:04 -04:00
Denis Rouzaud
edfb7e1465 run sipify 2018-12-18 17:17:25 -04:00
Nyall Dawson
514c5e2ac5 [api] Raises ValueError and TypeError exceptions when QgsGeometry.asPolygon()
is called on non-single-polygon geometries

Previously we would just return an empty list when geometries of invalid
type were used, but this is dangerous and we are safer to explicitly
raise errors preventing use of asPolygon() with incompatible geometry types.
2018-12-19 05:22:11 +10:00
Nyall Dawson
06d5f924f6 More square brackets 2018-12-19 05:21:49 +10:00
Matthias Kuhn
13de14a114
Merge pull request #8663 from qgis/m-kuhn-patch-1
Hint where to find select features method
2018-12-18 14:21:00 +01:00
Nyall Dawson
7d648e5b51 Improve Python __repr__ handling for null geometries
Also avoid massive long __repr__ strings for complex geometries,
as these can flood the Python console (and first aid plugin),
and aren't useful for debugging anyway.

Refs #14640
2018-12-18 18:11:22 +10:00
Nyall Dawson
089a2f1c17 [FEATURE][layouts] Add new setting to control whether map items
should show partial labels

Layout map items no longer respect the default project setting
for "show partial labels", and instead have their own, per map
setting for this option. (Under the map item properties,
labeling settings button).

The map item setting always defaults to off (unlike the canvas
setting, which defaults to true for a new project) as layouts
should always default to the settings which produce the highest
quality cartographic outputs.

In general I suspect that most users would always want to avoid
rendering partial labels in layouts, but this setting was
previously so deeply hidden that most are unaware of how to
change it. (And previous discussion about changing the canvas
setting to hide partial labels deemed this default undesirable
for the canvas, where showing even a small part of a label
on the map border can help identify what sits just on/off
the edges of the map)
2018-12-18 15:32:29 +10:00
Nyall Dawson
cdd23e663e [needs-docs][layouts] Move pushbutton actions for map items up to
a toolbar in the map item properties panel

This moves the
- refresh preview
- set to map canvas extent
- view extent in map canvas

buttons from being oversized push buttons within the item properties
panel up to a new toolbar at the top of this panel. Apart from looking
better, it means these important actions are always visible regardless
of the scroll position of the item properties panel itself.
Additionally, it makes it possible to add MORE actions here without
overloading the UI (e.g. "set canvas extent to item extent")

TODO: better icons
2018-12-18 10:31:24 +10:00
Nyall Dawson
5acd7ffaef [processing] Add API to set default unit to distance parameters
Otherwise the API forces use of a corresponding CRS parameter in
order to determine the relevant distance unit, but this is not
always desirable
2018-12-18 04:39:06 +10:00
Nyall Dawson
9e1bf68902 [processing] Fix pixel centroids along lines handling of null geometries 2018-12-18 04:38:42 +10:00
Nyall Dawson
d1e9ce1f69 [api] Raises ValueError and TypeError exceptions when QgsGeometry.asPolyline()
is called on non-single-line geometries

Previously we would just return an empty list when geometries of invalid
type were used, but this is dangerous and we are safer to explicitly
raise errors preventing use of asPolyline() with incompatible geometry types.
2018-12-18 04:38:42 +10:00
Peter Petrik
e4d490531c add support for browser dialog for mesh layer extensions too 2018-12-17 12:01:17 +01:00
Peter Petrik
64b81bd976 use file filters from MDAL 2018-12-17 12:01:17 +01:00
Peter Petrik
e71660215c [processing] add QgsProcessingParameterMeshLayer parameter 2018-12-17 11:50:53 +01:00
Matthias Kuhn
69298527d9
Run sipify 2018-12-17 09:43:11 +01:00
Nyall Dawson
c7cb5a8e3b [processing][SAGA] Fix output type of Zonal Grid Stats alg
and add unit test

Fixes #20815
2018-12-17 10:50:47 +10:00
Alessandro Pasotti
1ff3ddc61c
Merge pull request #8676 from elpaso/bugfix-20674-dbmanager-aliased-2
fix spatialite aliased, nested, joined queries
2018-12-15 14:54:55 +01:00
Nyall Dawson
cd762da817 Doxygen 2018-12-15 11:28:56 +10:00
Nyall Dawson
d8eac4797e [FEATURE][API] Add method to QgsMapSettings for specifying label blocking regions
These represent areas of the map where NO labels should be placed
2018-12-15 11:28:56 +10:00
Nyall Dawson
ed25a3e2ee [FEATURE][layouts] Add setting for label margin for map items
This setting allows per-map control of how close labels are permitted
to be placed to the map item's edges.

Sizes can be set using mm/inches/pixels/etc, and data defined
label margins are allowed.

Fixes #10314
2018-12-15 11:28:56 +10:00
Nyall Dawson
35855b88e1 [FEATURE][API] Add API to set a margin for labels for layout map items
This controls how close labels are permitted to the edges of the map
item. The labeling engine will then try other candidate positions
in order to avoid placing labels within this margin.
2018-12-15 11:28:56 +10:00
Nyall Dawson
4252aabe00 [FEATURE][API] Add option to specify a custom boundary geometry
in QgsMapSettings to restrict where labels are allowed to be placed
within.

If set, this overrides the default behavior of allowing labels to
be placed anywhere inside the rendered map extent.
2018-12-15 11:28:56 +10:00
Nyall Dawson
abc7b037d8 [needs-docs][processing] Output count of retained and duplicate features from
Delete duplicate geometries algorithm.

This matches the output of the delete duplicates by attribute
algorithm
2018-12-15 10:44:33 +10:00
Nyall Dawson
82c13bdde0 [processing] Fix error when running delete duplicate geometries and
some input features have null geometries

Fixes #20788
2018-12-15 10:44:33 +10:00
Nyall Dawson
5c2f68e769 [processing] Throw error when attempting to use Distance Matrix with
multipoint datasets

There's no single approach to use for multi-point inputs, so instead
of overloading this algorithm with extra options to control how these
are handled, we raise a helpful error and push the reponsibility back
to the user to get the data into the right format before running the
tool.

Fixes #20799
2018-12-15 10:36:44 +10:00
Nyall Dawson
11ea28a5b3 [FEATURE][processing] Add a new parameter type for authentication config
This adds a new available parameter type for processing algorithms,
QgsProcessingParameterAuthConfig, allowing selection from available
authentication configurations (and creation of new ones).

It allows creation of processing algorithm which can fully take
advantage of QGIS' mature authentication handling, avoiding the
need to use insecure string parameters for users to input
sensitive logon credentials.

QgsProcessingParameterAuthConfig parameters are evaluated using
QgsProcessingAlgorithm.parameterAsString(), which returns the
selected authentication configuration ID.
2018-12-15 08:23:10 +10:00
Nyall Dawson
0ca9777755 [api] Raises ValueError and TypeError exceptions when QgsGeometry.asPoint()
is called on non-single-point geometries

Previously we would just return QgsPointXY(0,0) when geometries of invalid
type were used, but this is dangerous and we are safer to explicitly
raise errors preventing use of asPoint() with incompatible geometry types.
2018-12-15 07:40:33 +10:00
Alessandro Pasotti
3618d63ca6 Show an error message when a query yields an invalid layer
... instead of failing silently
2018-12-14 15:09:46 +01:00
Nyall Dawson
44bbf1f137 Dox++ 2018-12-13 10:11:24 +10:00
Matthias Kuhn
4e38193bf3
Merge pull request #8627 from m-kuhn/represent_class_values
Use represention values for classified renderers [FEATURE]
2018-12-11 16:44:17 +01:00
Nyall Dawson
0659427ff7 Dox++ 2018-12-11 12:28:29 +10:00
Nyall Dawson
7ed4218b00 [needs-docs] Upgrade project level setting for Label as Outlines/text setting to use newer API
And replace labeling engine dialog "Draw text as outlines" checkbox with a combobox
presenting the choice of always rendering as outlines OR text.

(This will allow us to easily add additional methods in future, e.g. potentially
a "Render as text wherever possible" setting, for defaulting to text objects
whenever it doesn't impact the rendering quality to do so)
2018-12-11 12:28:29 +10:00
Nyall Dawson
ea069ed60e Push text format rendering setting into QgsLayoutExporter 2018-12-11 12:28:29 +10:00
Nyall Dawson
6755cbd6cf Push text format setting to layout render context 2018-12-11 12:28:29 +10:00
Nyall Dawson
1eaf95a866 [api] Move setting to control how text is rendered to QgsRenderContext
The new QgsRenderContext::TextRenderFormat enum controls how text
should be handled during a render operation, e.g. whether to render
text as outlines (paths) or keep it as real text objects.

Deprecate previous arguments in QgsTextRenderer which handled
this same use case.

This allows us to make the setting vary per-render, instead of
having a single global flag controlling the setting. Ultimately
this will allow us to have different behaviour within the
canvas renders vs print layout exports.

Refs #3975
2018-12-11 12:28:29 +10:00