1515 Commits

Author SHA1 Message Date
Juergen E. Fischer
05b8a985a5 indentation update 2015-08-25 20:04:50 +02:00
Nathan Woodrow
b5362b0fdb Fix broken conditional styles tests 2015-08-25 23:10:06 +10:00
Nathan Woodrow
9094575b80 Merge branch 'master' of https://github.com/qgis/QGIS
Conflicts:
	src/gui/attributetable/qgsfieldconditionalformatwidget.cpp
2015-08-25 22:45:05 +10:00
Nyall Dawson
385a608a0b Fix a bunch of leaks in unit tests 2015-08-25 21:40:41 +10:00
Nathan Woodrow
01d635a9ae Merge remote-tracking branch 'origin' 2015-08-25 21:39:52 +10:00
Nyall Dawson
a954c3f2bb Fix some memory leaks 2015-08-25 21:39:33 +10:00
Nyall Dawson
9aecf9f236 Test mask update 2015-08-25 08:42:25 +10:00
Nyall Dawson
3c0fe13207 Fix crash in geometry serialisation when no geometry set 2015-08-24 22:14:12 +10:00
Nyall Dawson
46114659a8 More robust maprotation label test
Previous test was too reliant on platform-specific font rendering
2015-08-24 12:49:50 +10:00
Nyall Dawson
7871d6c5fc Remove a bunch of layer variables, replace with new layer_property
function

layer_property takes a layer name/id and a property (eg 'crs')
and returns the matching value. This approach is more flexible than
having all these values as variables, since it allows retrieval
of properties of a layer from contexts which aren't layer-aware
(eg a composer label showing the metadata of a layer).
2015-08-24 12:00:11 +10:00
Nathan Woodrow
83115cd16a Merge row style support for attribute table
Conflicts:
	python/core/qgsconditionalstyle.sip
	python/core/qgsfielduiproperties.sip
	src/core/qgsfielduiproperties.cpp
	src/core/qgsfielduiproperties.h
	src/gui/attributetable/qgsattributetablemodel.cpp
	src/ui/qgsfieldconditionalformatwidget.ui
	tests/src/python/test_qgsconditionalstyle.py
2015-08-23 12:35:29 +10:00
Nathan Woodrow
b87073e146 Refresh attribute table for row styles. Tests 2015-08-23 10:53:03 +10:00
Juergen E. Fischer
b39055b39c indentation update (now including autopep8) 2015-08-22 14:29:41 +02:00
Nyall Dawson
8f6669fcb5 Fix missing QgsExpressionContext::isReadOnly definition 2015-08-22 19:01:43 +10:00
Nyall Dawson
4bf8b131e3 Port conditional styles to expression contexts 2015-08-22 19:01:43 +10:00
Nyall Dawson
bfc8f56ad4 Display variables and functions from contexts in expression builder 2015-08-22 19:01:42 +10:00
Nyall Dawson
0cab6b3376 Port renderers to expression contexts 2015-08-22 19:01:40 +10:00
Nyall Dawson
5e03016b3a Update QgsDataDefined for expression contexts 2015-08-22 19:01:40 +10:00
Nyall Dawson
f9a78207a7 Port QgsExpression tests to contexts 2015-08-22 19:01:39 +10:00
Nyall Dawson
d6542276e7 Add a bunch of layer related variables, including things like
metadata, extent, crs, feature count, geometry types, etc...
2015-08-22 19:01:39 +10:00
Nyall Dawson
f6e0ce788e New framework for context based expressions
This commit adds the ability for expressions to be evaluated against
specific contexts. It replaces the previous behaviour where
expressions were evaluated against a specific feature and could
utilise fragile global "special columns".

Now, expressions are instead evaluated using a context designed for
each individual expression. This is done via QgsExpressionContext
and QgsExpressionContextScope objects.

A QgsExpressionContextScope encapsulates the variables and functions
relating to a specific context. For instance, scopes can be created
for "global" variables (such as QGIS version, platform, and user-set
variables specified within the QGIS options dialog. Think things
like user name, work department, etc), or for "project" variables
(eg project path, title, filename, and user-set variables set
through the project properties dialog. Project version, reference
number, that kind of thing). Many more scopes are planned, including
map layer scopes (variables for layer name, id, user-set variables
through the layer properties dialog), composer scopes, etc...

QgsExpressionContextScopes are 'stacked' into a QgsExpressionContext
object. Scopes added later to a QgsExpressionContext will override
any variables or functions provided by earlier scopes, so for
instance a user could override their global 'author' variable set
within QGIS options with a different 'author' set via the project
properties dialog.

The intended use is that a QgsExpressionContext is created before
a batch set of QgsExpression evaluations. Scopes are then added to
the context based on what makes sense for that particular
expression. Eg, almost all contexts will consist of the global
scope and project scope, and then additional scopes as required.
So a composer label would be evaluated against a context
consisting of the global scope, project scope, composition scope
and finally composer item scope. The batch set of expression
evaluations would then be performed using this context, after which
the context is discarded. In other words, a context is designed
for use for one specific set of expression evaluations only.
2015-08-22 19:01:39 +10:00
Nyall Dawson
57669e71c0 Make QgsRenderContext available to more renderer methods 2015-08-22 19:01:38 +10:00
Nyall Dawson
86ace247c5 Test mask updates 2015-08-22 18:52:22 +10:00
Nyall Dawson
8cbfe00343 Bump acceptable doc coverage 2015-08-21 10:39:13 +10:00
Nyall Dawson
ee139b929c Tweak documentation coverage test
Ignore some obvious members which don't require docs:
- constructors with no arguments
- = and == operators

Also show list of undocumented members for each class
2015-08-21 10:05:51 +10:00
Nathan Woodrow
faa32f36cf [FEATURE] Conditional formatting for attribute table cells 2015-08-20 23:06:31 +10:00
Nyall Dawson
b87e5f7573 [FEATURE][composer] Data defined style preset for composer maps
Sponsored by City of Uster
2015-08-19 20:43:19 +10:00
Nyall Dawson
612df6ae14 [FEATURE][composer] Auto wrapping for text in fixed width columns
in attribute tables

Sponsored by City of Uster
2015-08-19 06:08:22 +10:00
Nyall Dawson
b78564899a [FEATURE][composer] Option for 'wrap text on' for attribute tables
Fix #8006

Sponsored by City of Uster
2015-08-19 05:16:12 +10:00
Nyall Dawson
759f842bc3 [FEATURE][composer] Vertical alignment control for attribute tables
Sponsored by City of Uster
2015-08-19 05:16:12 +10:00
Nyall Dawson
372534eb89 [composer] Add proper handling of multiline text in attribute tables
Previously multi-line text would overflow onto neighbouring cells.
Now rows will be expanded to fit required height of text.
Fix #10273.

Sponsored by City of Uster
2015-08-19 05:16:12 +10:00
Nyall Dawson
29cc0642a4 [composer] Add method for calculating height of text
Sponsored by City of Uster
2015-08-19 05:16:12 +10:00
Nyall Dawson
7527638d43 [FEATURE][composer] Data defined control over map layers
Adds new data defined control for the map layers to show in a
composer map. Expression result should be a | delimited list of
layer names which will be shown in the map.

Sponsored by City of Uster
2015-08-17 23:46:13 +10:00
Matthias Kuhn
9fc1b48bf3 Replace str() with unicode() and some PEP 8 2015-08-16 20:58:43 +02:00
Nyall Dawson
42d5b9b2aa Python exceptions for invalid keys in QgsFields methods (fix #13221) 2015-08-16 16:08:04 +10:00
Nyall Dawson
e9ff061f05 Cleanup composer label atlas handling 2015-08-13 08:35:47 +10:00
Nyall Dawson
19a833c23d Clean atlas interface - avoid storage of pointer to atlas feature 2015-08-13 08:35:43 +10:00
Nyall Dawson
a89550ac48 Update label server test mask images for OSX 2015-08-12 23:38:42 +10:00
Matthias Kuhn
d8d9ba1f3f Fix indentation, followup 8ab69e9 2015-08-12 15:12:53 +02:00
Matthias Kuhn
8ab69e9386 with edit(layer) raises an error if the commit fails 2015-08-12 14:55:36 +02:00
Matthias Kuhn
35fc2902f3 [FEATURE] Add with edit(layer): to python
Example:

    with edit(layer):
        f=layer.getFeatures().next()
        f[0]=5
        layer.updateFeature(f)

This will automatically call commitChanges() in the end.
If any exception occurs, it will rollBack() all the changes.
2015-08-12 13:41:23 +02:00
Nyall Dawson
3898d840bd Custom properties for QgsComposition and QgsComposerObject 2015-08-11 20:32:14 +10:00
Nyall Dawson
d8da4b8037 Followup 71e7aab, add unit tests 2015-08-08 15:54:19 +10:00
Nyall Dawson
ce0eb2b69e Cleanup QgsVectorLayer tests 2015-08-08 15:54:15 +10:00
Nyall Dawson
013e1da783 Tests and doxygen for QgsDataDefined 2015-08-07 09:05:47 +10:00
Chris Crook
dc2de774c2 Removing unnecessary restriction on field names 2015-08-07 09:06:31 +12:00
Alessandro Pasotti
c4ea8de5ed Merge pull request #2236 from elpaso/sip-server-filters-bindings
[server] Sip server filters new bindings
2015-08-06 21:05:31 +02:00
elpaso
e930d696fa [server] setFilters implementation, bindings and test
* moved type conversion to conversions.sip (template)
* added setFilters() to QgsServerInterface
* added tests
2015-08-06 17:51:26 +02:00
Nyall Dawson
be411e110b Add some unit tests for color ramps 2015-08-05 14:46:53 +10:00
elpaso
230196071a Added TypeHeaderCode for QgsServerFiltersMap 2015-08-04 20:55:42 +02:00