Nyall Dawson
9a2ca1cebd
Merge pull request #3673 from nyalldawson/constraints
...
[FEATURE] Improved constraint handling, pt 1
2016-11-04 10:34:15 +10:00
nirvn
769c82b579
[pal] fix curved labels failure with zero-width characters
...
(fixes 15801)
2016-11-03 13:35:51 +07:00
Even Rouault
06dc501139
test_provider_ogr_gpkg.py: Test disabling walForSqlite3 setting
2016-11-02 12:40:20 +01: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
e3a608365f
fix test
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
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
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
3e40f803c3
Implement constraint detection for spatialite provider
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
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
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
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
b798040040
Fixed legend renderer expected images
2016-11-01 11:41:23 +08:00
Matthias Kuhn
6d387650f4
More test for referencedVariables
2016-10-31 14:24:34 +01: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
2b545822e7
[FEATURE] New expression function 'extend'
...
Extends linestrings by a specified amount at the start and
end of the line
2016-10-31 07:56:24 +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
7a05a7a8c4
Fix caching of aggregate values with @parent
...
And add a test for referencedVariables
2016-10-28 12:31:40 +02:00
nirvn
17fc7dbe53
[FEATURE] add array_distinct() function
2016-10-28 10:51:14 +07:00
Matthias Kuhn
0b3646b252
Expression functions can dynamically report geometry and columns
2016-10-27 23:11:51 +02:00
Matthias Kuhn
f292fdd625
Add test for @parent aggregate filter
2016-10-27 23:11:51 +02:00
Nyall Dawson
fb4578131f
Merge pull request #3678 from nirvn/string_to_array_to_string
...
[FEATURE] add string_to_array() and array_to_string() functions
2016-10-28 04:44:25 +10:00
Matthias Kuhn
01f3c9ae38
[FEATURE] Add is_selected and num_selected functions
...
* is_selected() returns if the current feature is selected
* num_selected() returns the number of selected features on the current layer
* is_selected(layer, feature) returns if the "feature" is selected. "feature"
must be on "layer".
* num_selected(layer) returns the number of selected features on "layer"
2016-10-27 17:24:15 +02:00
Matthias Kuhn
f52dfba21e
[expressions] Variable length arguemnt functions accept 0 params
2016-10-27 17:24:15 +02:00
nirvn
7373036edf
[FEATURE] add string_to_array() and array_to_string() functions
2016-10-27 22:12:59 +07:00
Even Rouault
984ec65fcd
[DBManager GPKG] Set appropriate icon for line layers
2016-10-27 15:59:57 +02:00
nirvn
3fb2d9e4e3
[expression] further improve replace() to support a map argument
2016-10-27 11:33:28 +07:00
nirvn
8b74201470
[FEATURE] array support for the replace() expression function
2016-10-26 17:01:56 +07: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
6f82740670
[expressions] Allow non-greedy regex by switching to QRegularExpression
2016-10-26 16:04:38 +10:00
Even Rouault
3b77e4b395
[FEATURE] [OGR provider] Load/save style in database for GPKG and Spatialite
2016-10-25 10:28:54 +02:00
Nyall Dawson
1367fd09fc
Prepare commit converts single line doxygen block format
...
Flips single line doxygen comments to use the proper single line
format:
/*!< comment */ to //!< Comment
and
/** comment */ to //! Comment
2016-10-25 09:17:39 +10:00
Matthias Kuhn
cc0ada9f11
Add a hyperlink to the processing tests readme
2016-10-24 14:37:28 +02:00
Harrissou Sant-anna
8f13d4e242
typo fix
2016-10-24 14:33:22 +02:00
Sandro Santilli
96e7883b13
Add more links to test-relted README files
2016-10-24 11:43:36 +02:00
Sandro Santilli
31cd7a81a3
Add link to processing test document
2016-10-24 11:20:22 +02:00
Even Rouault
af236c4ef8
Merge pull request #3628 from rouault/dbmanager_gpkg
...
[DBManager] Add dedicated GeoPackage plugin
2016-10-24 10:33:03 +02:00
Nyall Dawson
4166a3ea62
Fix most clazy qstring-unneeded-heap-allocations warnings
...
By flipping string literals to QStringLiteral/QLatin1String
see
https://woboq.com/blog/qstringliteral.html
2016-10-24 15:26:24 +10:00
Nyall Dawson
8fa8167d7b
Add a simple dialog for configuring text formatting
2016-10-24 12:02:00 +10:00