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
Nyall Dawson
76c12ba94c
Split QgsLabelingGui off into QgsTextFormatWidget
...
New widget allows for setting just the formatting properties
of text
2016-10-24 12:02:00 +10:00
Nyall Dawson
a5356011fc
Test masks
2016-10-24 12:02:00 +10: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
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
Matthias Kuhn
54b953f433
Cleanup and modernize QgsProject code
2016-10-23 20:54:41 +02:00
Nyall Dawson
fae8071a1e
Fix clazy qstring-arg warnings
...
Avoid chained QString::arg() calls and instead use the multi-arg
overload to save memory allocations
2016-10-22 22:46:15 +10:00
Nyall Dawson
f2672151c2
Fix clazy qfileinfo-exists warnings
...
From the clazy docs:
Finds places using QFileInfo("foo").exists() instead of the faster
version QFileInfo::exists("foo"). According to Qt's docs: "Using
this function is faster than using QFileInfo(file).exists() for
file system access."
2016-10-22 22:46:14 +10:00
Nyall Dawson
ef5110732b
Fix clazy "qstring-ref" warnings
...
From the clazy docs:
Finds places where QString::fooRef() should be used instead of
QString::foo(), to avoid temporary heap allocations
eg
str.mid(5).toInt(ok) // BAD
str.midRef(5).toInt(ok) // GOOD
2016-10-22 22:46:14 +10:00