46850 Commits

Author SHA1 Message Date
Nyall Dawson
222977f23b Add unit tests for loading projects with custom layer order
Refs #18620
2018-04-06 15:55:40 +10:00
Nyall Dawson
1942854166 [processing] Port Explode Lines to c++
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.
2018-04-06 15:34:52 +10:00
Nyall Dawson
fa051d5f2d Add qgis::overload method for new-style Qt connects
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
2018-04-06 12:45:52 +10:00
Nyall Dawson
ebab649438 Fix some locator filters show results when no string is entered
and filter prefix is not used
2018-04-06 12:44:56 +10:00
Nyall Dawson
ccb72ebce2 [processing] Fixes for Service Area algorithms
- 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.
2018-04-06 12:43:52 +10:00
Nyall Dawson
2e7455c180 Add some geometry utils for interpolating points on lines 2018-04-06 12:43:52 +10:00
Nyall Dawson
78a6118ba4 [processing] Fix broken Densify by Interval algorithm, add test
Fix #18640
2018-04-06 11:50:23 +10:00
Nyall Dawson
6a925f9e87 Don't set cleared data defined properties to NULL in expression editor
Fixes #18638
2018-04-06 11:40:28 +10:00
Nyall Dawson
3c08e2d96f [layouts] Fix data defined buttons do not update when clicking
between items of same type

Fixes #18637, #18639
2018-04-06 11:31:18 +10:00
Nyall Dawson
3b8d8434af [locator] Set correct parent for filter configuration widgets 2018-04-06 10:57:39 +10:00
Nyall Dawson
25a9929dea Fix Coverity uninitialized member warning 2018-04-06 09:41:10 +10:00
Nyall Dawson
0ef9c729c0 Fix Coverity unreachable code warning 2018-04-06 09:41:01 +10:00
Salvatore Larosa
bcf9a97c4a fix tab index in project properties when clicking on crs toolbutton from statusbar 2018-04-05 16:55:48 +02:00
Alessandro Pasotti
16e18ba623
Merge pull request #6751 from elpaso/bugfix-18620-layer-custom-order
[bugfix] Layer rendering order broken in QGIS 3x
2018-04-05 12:08:22 +02:00
Alessandro Pasotti
958cb3dd15 [bugfix] Layer rendering order broken in QGIS 3x
Fixes #18620
2018-04-05 11:41:50 +02:00
Martin Dobias
63130d410d Another piece of random useless code in QGIS. Happy April 1st!
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.
2018-04-05 10:13:58 +02:00
MieWinstrup
7d65ee9fa4 Added tests for moving group to the top 2018-04-05 11:49:11 +10:00
MieWinstrup
44df14d941 Add test for move to top action 2018-04-05 11:49:11 +10:00
MieWinstrup
b57a154b4d Changed itemorder in menu to match the changes in #6665 2018-04-05 11:49:11 +10:00
MieWinstrup
40abe1430f Replaced deprecated Q_FOREACH with for loop 2018-04-05 11:49:11 +10:00
MieWinstrup
98621d7cd0 Added documentationstrings to new methods 2018-04-05 11:49:11 +10:00
MieWinstrup
924e2ec854 [FEATURE][Needs-docs] Move layer or group to top of layer panel
A feature that moves the layer(s) or group(s) to the top of the layer panel.
2018-04-05 11:49:11 +10:00
Nyall Dawson
cae5f81ed1 Add missing expression help 2018-04-05 06:35:13 +10:00
Nyall Dawson
f9783ea560 [FEATURE] Add flip_coordinates expression function
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.
2018-04-05 06:35:13 +10:00
Nyall Dawson
8aa9a82d28 [FEATURE][processing] Add algorithm to swap x/y coordinate values
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.
2018-04-05 06:35:13 +10:00
Nyall Dawson
63c5e74946 Fix clazy pass small and trivially copyable object by value warnings 2018-04-05 06:35:13 +10:00
Nyall Dawson
8cc715389e Fix warnings 2018-04-05 06:35:13 +10:00
Nyall Dawson
1ea20a4b35 Add method to swap x/y coordinates in geometries
This can be used to repair geometries which have
accidentally had their latitude and longitude coordinates
reversed.
2018-04-05 06:35:13 +10:00
Denis Rouzaud
b19aef39dc
[travis] also timeout tests (#6747) 2018-04-04 12:19:03 -04:00
lbartoletti
a213fad532 Fix travis with ccache (#6745) 2018-04-04 07:17:57 -04:00
Matthias Kuhn
9cece3e5ba Removed unused Q_UNUSED 2018-04-04 12:29:40 +02:00
nirvn
74adc04e6e Clear hidden toolbars/panels setting when restoring view 2018-04-04 16:44:22 +07:00
nirvn
1b9f41d03d Insure canvas rendering jobs are cancelled when exiting QGIS 2018-04-04 16:23:41 +07:00
Richard Duivenvoorde
282a999ba8 [FEATURE] Ctrl-shift-tab to toggle full map view (#6580) 2018-04-04 16:22:34 +07:00
Nyall Dawson
846ca49755 Fix Escape key press should close current stacked panel
Code was present but not correctly hooked up before
2018-04-04 16:37:34 +10:00
Matthias Kuhn
7e6f423e42
Merge pull request #6403 from signedav/new_multiselect
Horizontal space at value relation widget at multiple selection
2018-04-04 08:12:09 +02:00
Nyall Dawson
e3bbc35bed [processing] Fix incorrect error string in field mapper algorithm 2018-04-04 05:27:32 +10:00
Nyall Dawson
d5617b8025 [processing] Allow QgsVectorLayerSelectedFeatureSource to
create expression context scopes

Allows algorithms which require the underlying layer scope
to operate correctly when running in selected features only
mode.

Fixes #17170
2018-04-04 05:27:32 +10:00
Nyall Dawson
8326510e0e [processing] If an exception occurs while processing a feature
in a feature-based algorithm, don't try to continue processing
remaining features

Avoids multiple error dialogs appearing for every feature
in a layer...
2018-04-04 05:27:32 +10:00
Nyall Dawson
f4445a0493 [processing] Always log python exceptions to logger
Because Python code cannot catch and rethrow c++ exceptions
without losing context, we end up getting unknown exceptions
caught by c++ from python code (phew!).

So if we catch a python exception from processing, throw it
into the log so at least there's the full debugging detail
available on the console.

(Not ideal. Would love to see a PR allowing the full error
message to be passed correctly between c++/python/back again)
2018-04-04 05:27:32 +10:00
Nyall Dawson
615cb6ca71 [needs-docs] In merge features dialog, if a layer has default
values/default value clauses present, then use these as the
initial value for the merged feature

Otherwise the dialog defaulted to skipping these attributes
or taking a value from an existing feature, which meant
that it could violate constraints on the backend.

Users can still easily overwrite these values if desired.

Fixes #18397
2018-04-04 05:27:12 +10:00
Nyall Dawson
001796dd09 Fix merge attribute dialog picks wrong field values when fields are hidden 2018-04-04 05:27:12 +10:00
Nyall Dawson
adf5d793c7 In merge attributes dialog, don't show editor widgets in table
This was originally done to allow the table to show mapped values
such as value maps/relations. But it creates the false impression
that these values are editable, since the editor widgets are
not read only.

Instead, use the field formatter to create a value representation
string and make the body of the table read-only instead.
2018-04-04 05:27:12 +10:00
Alessandro Pasotti
1ff91ceb83
Merge pull request #6690 from elpaso/fix-android-build
Fix android build with osgeo4a
2018-04-03 17:19:29 +02:00
rldhont
24737be1b8 [BUGFIX][Server] Enhance cleaning propertyname and searching by propertyname 2018-04-03 17:18:04 +02:00
David
c8504cd446 move includes into cpp and insert forward declaration 2018-04-03 17:13:43 +02:00
Alessandro Pasotti
e702bd4a11 Keep native nodiscard 2018-04-03 14:41:12 +02:00
Juergen E. Fischer
e7d587f423 restore ico/tif/png nuked by fcacb0db7c 2018-04-03 12:24:21 +02:00
Nyall Dawson
08d30c3b9f [processing] Add method for algorithms to preprocess parameter values
Allows algorithms to pre-processes a set of parameters, allowing the
algorithm to clean their values.

This method is automatically called after users enter parameters, e.g.
via the algorithm dialog. This method should NOT be called manually
by algorithms.
2018-04-03 18:36:39 +10:00
nirvn
a93daf1437 [processing] Throw exception when combining clip geometry fails in clip alg 2018-04-03 15:32:08 +07:00