2383 Commits

Author SHA1 Message Date
Matthias Kuhn
4981bfcf18 Fix memory leak 2016-11-11 16:55:57 +01:00
Nyall Dawson
1ef7ed53c9 Merge pull request #3703 from aaime/svg_params
Export parametric SVG, will fallback symbols for the systems that cannot understand them
2016-11-11 13:25:48 +10:00
Stéphane Brunner
6cf47bef1e Apply some @m-kuhn comments (#3736)
* Use QgsStringMap

* Better description

* Use new translated metadata methods
2016-11-08 23:16:11 +01:00
volaya
72fddb8b5e Merge pull request #3470 from arnaud-morvan/refactor_fields_context_generator
[Processing] Fix processing refactor fields algorithm using expression context generators
2016-11-08 10:45:32 +01:00
Nyall Dawson
fcb6c2bb9a Fix some incorrect return values from QgsFeature python bindings 2016-11-08 12:54:19 +10:00
Nyall Dawson
f9bb230665 Avoid some QgsGeometry pointer use in QgsGeometry API 2016-11-08 11:09:19 +10:00
Nyall Dawson
02ea2d7703 Fix typos 2016-11-08 09:05:47 +10:00
Nyall Dawson
1fea20de50 Split handling of literal default values from provider side
default value SQL clauses

QgsVectorDataProvider now has two methods:

- defaultValueClause: returns SQL fragment which must be evaluated
by the provider to obtain the default value, eg sequence values
- defaultValue: returns the literal constant default value
for a field
2016-11-08 08:18:16 +10:00
Stéphane Brunner
59b10d65b7 Merge pull request #3720 from sbrunner/WFS-provider-metadata
Add metadata for WFS provider in layer metadata informations
2016-11-07 17:15:03 +01:00
Stéphane Brunner
bc1ad2ce82 Add metadata for WFS provider in layer metadata informations 2016-11-07 16:46:39 +01:00
Nyall Dawson
983fe24806 Port some API from QgsPoint to QgsPointV2 2016-11-07 12:20:59 +10:00
arnaud.morvan@camptocamp.com
a8d9dea1fb Add QgsExpressionContextGenerator inheritances in sip 2016-11-06 17:58:54 +01:00
Andrea Aime
701d4440ac Export parametric SVG parameters, will fallback symbols for the system that cannot understand them 2016-11-05 11:48:31 +01:00
Martin Dobias
5984b21852 Add missing /Factory/ annotations to geometry classes 2016-11-05 12:13:52 +08:00
Nyall Dawson
9a2ca1cebd Merge pull request #3673 from nyalldawson/constraints
[FEATURE] Improved constraint handling, pt 1
2016-11-04 10:34:15 +10:00
Alexander Bruy
dac03d5ce8 use default QString() constructor instead of ""
improve doxygen docs
2016-11-02 14:44:20 +02:00
Alexander Bruy
75b23cb55c update Python bindings 2016-11-02 14:44:20 +02:00
Nyall Dawson
3f2a7810cf Respect non-enforced constraints when editing/adding features
Warnings are shown, but features can be committed. Fields which
fail an unenforced constraint are now shaded in yellow to differentiate
from the red failure for enforced constraints.
2016-11-02 13:42:22 +10:00
Nyall Dawson
fac5bc0691 [FEATURE] Field constraints can be enforced or not
Non-enforced constraints just show a warning to the user, but
do not prevent committing the feature. Enforced constraints
block users from comitting non compliant features.

Any constraints detected by the provider are always
enforced.
2016-11-02 13:42:22 +10:00
Nyall Dawson
cb94b68d88 Move constraint handling to QgsFieldConstraints
Avoids cluttering QgsField API
2016-11-02 11:07:07 +10:00
Nyall Dawson
a6319a47d7 If the layer is NOT being edited then only check layer based constraints
and not any constraints enforced by the provider

Because:

1. we want to keep browsing features nice and responsive. It's nice to give
 feedback as to whether the value checks out, but not if it's too slow to
 do so. Some constraints (eg unique) can be expensive to test. A user can
 freely remove a layer-based constraint if it proves to be too slow to
 test, but they are unlikely to have any control over provider-side
 constraints

2. the provider has already accepted the value, so presumably it doesn't
 violate the constraint and there's no point rechecking!
2016-11-02 11:07:07 +10:00
Nyall Dawson
c98d380dc1 Move responsibility for testing for attribute against constraints
to QgsVectorLayerUtils::validateAttribute()

Also clean up some strings shown to the user when a constraint
check fails
2016-11-02 11:07:07 +10:00
Nyall Dawson
2500d75f5e Move responsibility for storage of constraint expressions to QgsVectorLayer 2016-11-02 11:07:07 +10:00
Nyall Dawson
f99ea26bdf Refactor constraint handling
- store constraint origin in QgsField
- move handling of constraint expressions to QgsField
2016-11-02 11:07:07 +10:00
Nyall Dawson
b7d0fd6f90 New class QgsVectorLayerUtils
Contains static helper methods for working with vector layers.
Initially only contains a method to test whether a value
exists within a layer's attributes.
2016-11-02 11:07:07 +10:00
Nyall Dawson
6bbd0061f3 Move handling of not null constraint from edit form to layer 2016-11-02 11:07:07 +10:00
Nyall Dawson
bd9f672aa7 Allow constraints to be added at a QgsVectorLayer level 2016-11-02 11:07:07 +10:00
Nyall Dawson
4efad04bd8 Move constraints to QgsField 2016-11-02 11:07:07 +10:00
Nyall Dawson
d1fd588499 Add method to fetch constraints from a vector data provider
Implemented for unique and not null constraints for postgres
provider
2016-11-02 11:07:07 +10:00
Martin Dobias
6b120a8600 Fix display of diagram legend entries (fixes #15448)
To make the implementation saner, the legend node that may be embedded within parent
layer node is kept separately from activeNodes.

(cherry picked from commit b385ebd9ba9272516eed61e5825a603fcee969e9)
2016-11-01 11:41:23 +08:00
Nyall Dawson
47109d13b7 Flip some connects to new style 2016-11-01 11:10:40 +10:00
Martin Dobias
24fbe1a080 Fix crash in node tool after deleting the whole geometry (fixes #15659)
Made sure that both closestVertex() and closestSegment() return negative
distance on error (e.g. with null or emtpy geometry).

Also fixes snapping when dealing with layers with null/invalid geometries

(cherry picked from commit c093d5188fad685c4a596ff23c27aad7d151dac2)
2016-10-31 12:51:21 +08:00
Nyall Dawson
bd950616ac Rename visible "favourite" strings to "favorite", change API to
use "favorite"
2016-10-31 08:00:19 +10:00
Nyall Dawson
ef34e393dc Add method to QgsGeometry to extend the start/end of a linestring 2016-10-31 07:56:24 +10:00
Matthias Kuhn
0b3646b252 Expression functions can dynamically report geometry and columns 2016-10-27 23:11:51 +02:00
Matthias Kuhn
f80a33be65 [FEATURE] Expose @parent variable in aggregate functions
This makes it possible to access attributes and geometry from the parent
feature when in the filter of the "aggregate" expression function.

With this in place aggregates can be calculated per feature.

E.g. max "measurement" for each point_station per polygon_research_area.

Or a default attribute value when digitizing features:

    aggregate(layer:='countries', aggregate:='max', expression:=\"code\",
filter:=intersects( $geometry, geometry(@parent) ) )
2016-10-27 23:11:50 +02:00
Even Rouault
2d2ce00341 Merge pull request #3665 from rouault/save_style_gpkg
[FEATURE] [OGR provider] Load/save style in database for GPKG and Spatialite
2016-10-26 11:04:25 +02:00
Nyall Dawson
49432a8468 Optimise QgsAbstractGeometry
Make nCoordinates virtual, and provide shortcuts for some
geometry types. The base method which calls coordinateSequence()
is quite slow in certain circumstances.

Speeds up rendering point layers by ~25%, also likely to
speed up lots of geometry heavy operations throughout QGIS

Refs #15752
2016-10-26 17:22:09 +10:00
Even Rouault
e237963274 SIP QgsVectorLayer: fix signatures for output parameter
saveStyleToDatabase() and getStyleFromDatabase() should define errMsg as
output parameter
And loadNamedStyle() also for theResultFlag.
2016-10-25 10:28:53 +02:00
Nyall Dawson
08143475ed [FEATURE] QgsTextRenderer class for rich text rendering
Moves all the drawing code out of labeling into a new class
which just handles rendering text. This allows other parts
of the code to utilise all the advanced formatting options
that labeling supports, eg rendering text with shadows,
buffers and backgrounds.
2016-10-24 12:02:00 +10:00
Nyall Dawson
5495f20589 Minor refactor of label drawing
Remove use of scale factors from PAL layer settings and use
render context factors directly
2016-10-24 12:02:00 +10:00
Nyall Dawson
aac2622816 Remove option to show label shadow rectangles from GUI
...and instead just make it #ifdef out
2016-10-24 12:02:00 +10:00
Nyall Dawson
4d5e7536d9 Flip QgsPalLayerSettings to use QgsTextRenderer classes 2016-10-24 12:02:00 +10:00
Nyall Dawson
5f241d6288 Implicitly shared text settings classes 2016-10-24 12:02:00 +10:00
Nyall Dawson
687c66f5d6 Add Points as valid render unit (for font sizes) 2016-10-24 12:02:00 +10:00
Nyall Dawson
44289084e9 Optimise passing of variables by ref/value 2016-10-24 10:36:23 +10:00
Nyall Dawson
3272964f58 Fix classes which violate the rule-of-three
(identified using clazy analyser)
2016-10-24 10:36:22 +10:00
Matthias Kuhn
96a649e37f Add missing bindings 2016-10-23 21:14:42 +02:00
Matthias Kuhn
54b953f433 Cleanup and modernize QgsProject code 2016-10-23 20:54:41 +02:00
Matthias Kuhn
1445647065 QgsVectorDataProvider API cleanup 2016-10-22 23:03:57 +02:00