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
e3a608365f
fix test
2016-11-02 13:42:22 +10:00
Nyall Dawson
3a59674901
Fix some untranslatable strings
2016-11-02 11:07:07 +10:00
Nyall Dawson
cb94b68d88
Move constraint handling to QgsFieldConstraints
...
Avoids cluttering QgsField API
2016-11-02 11:07:07 +10:00
Nyall Dawson
003fe1830c
Color a few pixels slightly differently
2016-11-02 11:07:07 +10:00
Nyall Dawson
bb6fc32eec
[FEATURE] Not null constraint detection for ogr provider
...
Implements not null constraint detection for the OGR layers, where
supported for the data format by OGR.
(only available for GDAL >= 2.0)
2016-11-02 11:07:07 +10:00
Nyall Dawson
210c98bedc
Fix failing unit test
2016-11-02 11:07:07 +10:00
Nyall Dawson
961b63f292
Update API break docs
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
1cecf37b40
Enforce unique constraints in attribute form
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
3e40f803c3
Implement constraint detection for spatialite provider
2016-11-02 11:07:07 +10:00
Nyall Dawson
21f885aa7a
Select all text after reset line edit to null
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
f6c1bf7f5b
Add gui for setting/exposing constraints in field properties
...
Provider set constraints cannot be changed by users, ie
if a not null constraint is set on the field at the database
then QGIS users cannot clear this constraint.
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
Nyall Dawson
5e3bef7799
Fix QgsFeatureRequest with expression not using provider fields
...
and limit (fix #15771 )
2016-11-02 09:52:03 +10:00
Matthias Kuhn
57a57545a0
Add test for QgsFeatureRequest.setLimit and feature variable
2016-11-02 09:39:59 +10:00
Nyall Dawson
fb849620e7
Avoid unexpected gpkg test success with older GDAL versions
2016-11-02 09:39:59 +10:00
Nyall Dawson
b679cbe091
Speed up inserting features into memory layers by ~65%
...
By avoiding an unnecessary map lookup
2016-11-02 08:46:49 +10:00
Juergen E. Fischer
d3c7a04193
fix typo
...
(cherry picked from commit 658cfe68c91ec24f04f8ebda307fbec7d55a412f)
2016-11-01 13:51:49 +01:00
Juergen E. Fischer
7a326b1b8d
fix typos
2016-11-01 13:46:29 +01:00
Patrick Valsecchi
667718bc89
[feature] Editor widget auto config for foreign keys ( #3699 )
...
Automatically pick RelationReference widgets for foreign keys.
2016-11-01 08:36:21 +01:00
Nyall Dawson
4f8ee78f76
Fix some no such signal/slot warnings
...
... in such a way that they'll never appear again
2016-11-01 14:14:16 +10:00
Martin Dobias
5e4bb00fa3
Fix import of shapefiles to postgres - regression introduced in 5abdfcb ( #3652 )
...
(cherry picked from commit a965a132c52df9308b5a58be92c04a285826485a)
2016-11-01 11:41:23 +08:00
Martin Dobias
629ca8b986
Hide import/export buttons for arcgis services as they do not work ( fixes #15637 )
...
(cherry picked from commit 1c2f0de9fbea8e90c9d20036bfa1601c1d192a89)
2016-11-01 11:41:23 +08:00
Martin Dobias
b798040040
Fixed legend renderer expected images
2016-11-01 11:41:23 +08:00
Martin Dobias
5c83b7924a
Fix reordering and removal of legend nodes in composer legend
...
(cherry picked from commit f4e1e6f6eefec74fcf61542c3c9e236c4fb3054f)
2016-11-01 11:41:23 +08:00
Martin Dobias
90e1c93661
Fix building of legend node tree if embedded widgets are used in the layer
...
(cherry picked from commit 10cab93c3652c38db27553616f36290f7b820c48)
2016-11-01 11:41:23 +08: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
Nyall Dawson
70d7ce163e
Describe some dependancy changes in API break docs
2016-11-01 08:44:55 +10:00
Even Rouault
08218de5f4
[OGR provider] Use constBegin() / constEnd()
2016-10-31 19:44:34 +01:00
Even Rouault
bb9c75b394
[OGR provider] Make addAttributes() return the requested field type, precision and width so as to make QgsVectorLayerEditBuffer::commitChanges() API
...
Fixes #15614
2016-10-31 17:10:58 +01:00
Matthias Kuhn
7d2098cdf4
Followup cc6b1e3: also respect subexp vars in presence of filter
2016-10-31 15:18:56 +01:00
Matthias Kuhn
cc6b1e3391
Fix @parent variable detection in aggregate subExpression
2016-10-31 14:25:35 +01:00
Matthias Kuhn
6d387650f4
More test for referencedVariables
2016-10-31 14:24:34 +01:00
Matthias Kuhn
25e983436d
Revert "[ogr] Ignore request limit if unable to compile expression"
...
This reverts commit e7333f68145f27a74aacd8f75939623e37fc4510.
2016-10-31 13:03:28 +01:00
Matthias Kuhn
e7333f6814
[ogr] Ignore request limit if unable to compile expression
...
Fix #15771
2016-10-31 12:15:20 +01:00
Matthias Kuhn
1b2158d854
Fix caching aggregate expressions with @parent usage
2016-10-31 12:15:14 +01:00
Matthias Kuhn
f438542fe7
Break oneliners
2016-10-31 09:45:52 +01:00
Nyall Dawson
88871c2320
Merge pull request #3696 from nirvn/processing_otb_silent
...
[processing] remove console error message when optional otb provider not installed
2016-10-31 16:24:44 +10:00
nirvn
8e663309c0
[processing] remove console error message when optional otb provider not installed
2016-10-31 12:53:42 +07:00
Nyall Dawson
fa3663907a
Fix 'enable macros' button does not run open macro ( fix #9523 )
2016-10-31 15:22:49 +10:00