7751 Commits

Author SHA1 Message Date
Nyall Dawson
83a842d44f Ensure ownership of path preprocessor is transferred 2019-07-25 08:41:28 +10:00
Nyall Dawson
2237c6ae99 [API][FEATURE] Allow setting a custom path pre-processor for QgsPathResolver
QgsPathResolver::setPathPreprocessor allows setting a custom path pre-processor
function, which allows for manipulation of paths and data sources prior
to resolving them to file references or layer sources.

The processor function must accept a single string argument (representing the
original file path or data source), and return a processed version of this path.

The path pre-processor function is called before any bad layer handler.

Example - replace an outdated folder path with a new one:

  def my_processor(path):
    return path.replace('c:/Users/ClintBarton/Documents/Projects', 'x:/Projects/')

  QgsPathResolver.setPathPreprocessor(my_processor)

Example - replace a stored database host with a new one:

  def my_processor(path):
    return path.replace('host=10.1.1.115', 'host=10.1.1.116')

  QgsPathResolver.setPathPreprocessor(my_processor)

Example - replace stored database credentials with new ones:

  def my_processor(path):
    path= path.replace("user='gis_team'", "user='team_awesome'")
    path = path.replace("password='cats'", "password='g7as!m*'")
    return path

  QgsPathResolver.setPathPreprocessor(my_processor)
2019-07-25 08:41:28 +10:00
Nyall Dawson
bbd2f65a6c Direct conversion from ogr multilinestrings to QgsGeometry
Avoid expense of converting to/from wkb
2019-07-24 16:41:37 +10:00
Nyall Dawson
4b79efcb19 Optimise reading of multipoints from OGR
Avoid WKB conversion on OGR side, and parsing on QGIS side, and
just handle the direct conversion of OGR geometries instead
2019-07-24 04:10:14 +10:00
Julien Cabieces
0dfa77ddb3 Add a new settings noProxyUrls and change UI to edit this setting 2019-07-23 19:03:51 +10:00
Julien Cabieces
906c8a1de0 fixes #28034 : Return NoProxy instead of DefaultProxy when url matches
excludes list
2019-07-23 19:03:51 +10:00
Nyall Dawson
45b23fd5b2 [callouts] Allow callout types to have icons, and use them in the type combobox
...and pick ugly icons to prompt @nirvn into action ;)
2019-07-23 12:12:18 +10:00
nirvn
aab8e511bd [FEATURE][callouts] Allow specifying an offset from label area distance 2019-07-22 18:29:05 +07:00
Nyall Dawson
2b554d8bab [FEATURE][callouts] Allow specifying an offset from feature distance
which controls a distance from the feature where callout lines end

Makes for visually more appealing callouts vs drawing them right
up against the edges of features
2019-07-22 18:40:08 +10:00
Nyall Dawson
f8cd54288c Improve appearance of multiline tooltips 2019-07-22 13:38:47 +10:00
Nyall Dawson
8f6f04885b [FEATURE] Add @scale_value expression variable for use when evaluating
data defined text format properties while rendering scale bar text

Allows for per-label customisation of the text format inside scale bars
2019-07-22 11:34:32 +10:00
Nyall Dawson
19a2b0e5d5 [api] Allow data defined properties to be set in QgsTextFormat, so
that these are automatically respected whenever the format is
rendered using QgsTextRenderer

This is done transparently to the caller - so by porting away
from the raw QPainter text apis to use QgsTextRenderer instead,
then they immediately gain the ability to use data defined
properties in their text formats.
2019-07-22 11:34:32 +10:00
Nyall Dawson
859d9a7233 Add test for drawing unplaced for a feature with no candidates 2019-07-21 20:29:34 +10:00
Nyall Dawson
c3b2f77a64 [FEATURE][labeling] Allow display of unplaced labels
This setting (accessed through the project label settings dialog)
allows unplaced labels to be shown on the map. These are rendered
using a red color by default (but the color can be changed from
the label settings dialog too), allowing users to determine whether
any important labels are missing from their maps (e.g. due to
overlaps or other constraints).
2019-07-21 20:29:34 +10:00
Nyall Dawson
39d4145aae Append additional "QgsCalloutContext" member to callout rendering virtual
methods

While unused for now, this gives us flexibility in future to specify
additional useful contextual information about how a callout should
be rendered without breaking API (e.g. label text alignment, label
font settings, etc)
2019-07-21 20:29:34 +10:00
Matthias Kuhn
4e0102f3b1
Merge pull request #30816 from m-kuhn/ellipsoid_from_first_layer
Update the project ellipsoid if CRS is taken from first layer
2019-07-20 10:29:54 +02:00
Matthias Kuhn
22dbeee989 Add test for QgsGeometryCheckError::contextBoundingBox() 2019-07-19 11:59:08 +02:00
Matthias Kuhn
ce8004446a Update the project ellipsoid if CRS is taken from first layer
Fix #30815
2019-07-19 11:08:39 +02:00
Matthias Kuhn
b1e5eb09cf
Merge pull request #30748 from troopa81/fix_referencerelationwidget_addEntry
Fix addEntry for reference relation widget
2019-07-19 07:08:11 +02:00
Nyall Dawson
dbe7e6156e Append additional "QgsCalloutContext" member to callout rendering virtual
methods

While unused for now, this gives us flexibility in future to specify
additional useful contextual information about how a callout should
be rendered without breaking API (e.g. label text alignment, label
font settings, etc)
2019-07-19 13:38:49 +10:00
Julien Cabieces
9a60f17565 Replace setted with set 2019-07-19 09:11:41 +10:00
Julien Cabieces
29883f18e5 fixes #29667 end feature setting mode before warning attribute form interface 2019-07-19 09:11:41 +10:00
David Signer
b4dab2df38 made QgsPostgresStringUtils namespace to class because of private functions we use there and possibly in future there are more coming and renamed the methods
fixed indents and comments
2019-07-18 09:25:34 +02:00
Nyall Dawson
83168d3a02 [FEATURE] Add a separate unit choice for milliradians (SI definition) vs mil (NATO definition)
Allows angular measurements in either of these units
2019-07-18 15:06:52 +10:00
Nyall Dawson
8cc54aed45 Correct definition of miliradians to 1/1000 radian, not 3200/pi radians
And add missing unit tests
2019-07-18 15:06:52 +10:00
David Signer
201dd0850b renamed QgsArrayUtils to QgsPostgresStringUtils 2019-07-17 16:50:58 +02:00
David Signer
109b4d7f21 improved parsing and building function to handle multidimensional arrays
code mostly taken from this integration in the postgresprovider / postgresconn
x
2019-07-17 16:24:42 +02:00
Julien Cabieces
8515bb81d9 Convert QVariant to int before QCOMPARE 2019-07-17 08:56:28 +02:00
David Signer
98a271b365 tests for arrayutils creating lists and parsing back 2019-07-17 07:47:54 +02:00
Nyall Dawson
9f219e0ca2 Spelling 2019-07-17 11:07:01 +10:00
Nyall Dawson
4ab51b02fc [labeling] Fix labels 'jump' when using move label tool and alignment
is set to a non-field based value
2019-07-17 11:07:01 +10:00
Nyall Dawson
e1bfb857da [labeling] When label map tools are used to select a label and the
user clicks on overlapping labels, prioritise either the labels in
the current layer OR fallback to picking the smallest candidate
label (since it will be the most difficult to select)
2019-07-17 11:07:01 +10:00
Matthias Kuhn
a51fbd6057 Add angle unit tests for mil 2019-07-17 04:26:29 +10:00
Julien Cabieces
dc51505541 Fix addEntry for reference relation widget and use referenced field
index and not referencing one
2019-07-16 15:55:14 +02:00
Nyall Dawson
1e4114a634 Fix creating auxilary field fails if _ present in field name 2019-07-16 20:53:35 +10:00
Denis Rouzaud
943cbd067c
[expressions] fix comparison of intervals (#30657)
* [expressions] fix comparison of intervals

* add test for interval comparison
2019-07-16 12:31:31 +02:00
nirvn
dded60611b [callouts] Add symbol-related variables to the expression context 2019-07-16 14:59:06 +07:00
luz.paz
aa3480b717 Fix typos 2019-07-16 11:29:42 +10:00
Nyall Dawson
b01c5e1e0e Add test for other callout stacking option 2019-07-16 07:46:58 +10:00
Nyall Dawson
171f06447a [callouts] Ensure simple callouts are rendered below all map labels
...instead of being rendered on top of some. For this callout style,
we don't want callouts overlapping labels (rather the opposite). But
leave API in place to allow other callout styles to render below
their associated labels only, as this may be wanted for some styles
(e.g. balloon style callouts)
2019-07-16 07:46:58 +10:00
Alex
248af94ba9 Symbol aware legend expression (#9648) 2019-07-15 07:12:24 +02:00
Nyall Dawson
e52b06eeb4 Unit test for feed language 2019-07-15 12:52:20 +10:00
Nyall Dawson
e783323fd7 Include lat/long in newsfeed url if available 2019-07-15 12:52:20 +10:00
Nyall Dawson
f4ea33fef1 Auto-prune expired news items on launch 2019-07-15 12:52:20 +10:00
Nyall Dawson
64ecc06fed Store publish_to field locally 2019-07-15 12:52:20 +10:00
Nyall Dawson
0a336d4c89 Adapt to upstream changes in feed 2019-07-15 12:52:20 +10:00
Nyall Dawson
79a404a419 Send language argument when requesting news feed 2019-07-15 12:52:20 +10:00
Nyall Dawson
da601982e1 Add dismissAll API 2019-07-15 12:52:20 +10:00
Nyall Dawson
4540685545 Add a proxy model to apply correct sorting to news feed entries 2019-07-15 12:52:20 +10:00
Nyall Dawson
298e2fe25e Add a model for news feeds 2019-07-15 12:52:20 +10:00