5010 Commits

Author SHA1 Message Date
Nyall Dawson
1c7a5b2dba Add editor widget for editing QgsExpressionContextScope variables 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
f5de32779f Add missing sip changes 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
Giuseppe Sucameli
4dc7eba107 DBManager: fix minor issues due to Query dialogs repleaced with Query tabs (ref commit 5fb52fa1edc)
In detail:
* hide close button from Info, Table and Preview tabs (it should work on Mac as well),
* always display dbtype icon into query tab
* show database name in tab text (otherwise we dunno which db the query is executed against)
* restore original tab text when query name becomes empty
2015-08-22 02:34:53 +02:00
Tom Kralidis
a8bd9995e1 update MetaSearch plugin metadata 2015-08-21 09:11:40 -04:00
Nyall Dawson
9d984b163e Immediately apply conditional formatting changes to table 2015-08-21 10:04:22 +10:00
Nyall Dawson
6a3357fab8 Fix warnings, add missing sip bindings 2015-08-21 05:45:49 +10:00
Nathan Woodrow
faa32f36cf [FEATURE] Conditional formatting for attribute table cells 2015-08-20 23:06:31 +10:00
volaya
3ff3b02ad7 Merge pull request #2247 from spencerrecneps/master
[Processing] Fixed bad variable references
2015-08-20 14:42:31 +02:00
Markus Neteler
424d3d337e Update Grass7Utils.py
In batchjob, use GRASS_MESSAGE_FORMAT=plain
2015-08-20 10:36:22 +02:00
Nyall Dawson
ca04bb6409 Allow more customisation of QgsNewNameDialog 2015-08-20 16:09:52 +10:00
Juergen E. Fischer
d2282a77c7 processing: when using batch jobs remove GISBASE from environment when calling GRASS (fixes #13072) 2015-08-20 01:10:43 +02:00
Bernhard Ströbl
1f81109b4a [PROCESSING] Fix Progress bar in Dissolve 2015-08-19 16:02:10 +02: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
0e567cd83b Fix doxygen warning 2015-08-19 20:00:37 +10:00
Nyall Dawson
73522dce7e Refactor visibility presets, so that all non-app specific
methods are now in core

A new QgsVisibilityPresetCollection object has been created
which stores a set of visibility presets. QgsProject now
contains a preset collection object.

This allows plugins and other core objects to retrieve and
modify visibility presets.
2015-08-19 19:07:23 +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
Juergen E. Fischer
697d2af533 processing: fix warning when loading otb algorithms 2015-08-18 11:06:32 +02:00
Nyall Dawson
46da64a88e [console] Better handling of default paths for open/save dialogs 2015-08-18 15:12:22 +10:00
Nyall Dawson
15e452e918 [console] Allow running unsaved script files
Previously a (non-default) option existed for auto-saving scripts
on run, which would overwrite the existing script file if set, or
save the script to a temporary file before running.

Now, the auto-save option only applies to scripts which have
already been saved an have a filename.

By default the console now can run scripts without filenames,
or scripts with changes by transparently saving them out to a
temporary file.
2015-08-18 15:12:14 +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
Nathan Woodrow
a05a970dff Add open in external editor to console 2015-08-17 23:25:26 +10:00
Nathan Woodrow
5fb52fa1ed Remove query dialog. Replace with tabs 2015-08-17 18:10:59 +10:00
Matthias Kuhn
9fc1b48bf3 Replace str() with unicode() and some PEP 8 2015-08-16 20:58:43 +02:00
Juergen E. Fischer
624f16cc2c indentation update 2015-08-16 11:56:27 +02:00
Nyall Dawson
42d5b9b2aa Python exceptions for invalid keys in QgsFields methods (fix #13221) 2015-08-16 16:08:04 +10:00
Spencer Gardner
94d3bdd01a fixed bad variable references 2015-08-15 22:17:35 -05:00
Denis Rouzaud
480a0f17c3 Don't send expressions with special fields to provider 2015-08-14 11:39:27 +02:00
Juergen E. Fischer
fee5da9071 fix typos 2015-08-13 22:52:01 +02:00
Juergen E. Fischer
ac89dc0e73 * update QgsSymbolV2 sip bindings
* fix a crash when setRotationField (now deprecated) is used on a fresh
  QgsCategorizedSymbolRendererV2
2015-08-13 17:48:56 +02:00
Nyall Dawson
19a833c23d Clean atlas interface - avoid storage of pointer to atlas feature 2015-08-13 08:35:43 +10:00
Matthias Kuhn
d32f3340ae Fix typo 2015-08-12 21:38:14 +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
f64783493e PyQgis: Move NULL and edit to qgis.core 2015-08-12 13:50:06 +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
Nathan Woodrow
9acc475197 Move python console toolbar to top. More uniform with rest of UI 2015-08-08 23:09:20 +10:00
elpaso
e48b6e8910 Moved QMultiMap<int, TYPE2*> to conversion.sip 2015-08-07 09:26:14 +02:00
Matthias Kuhn
9c3d65ef7b QgsDataDefined: Implicit management for useExpression 2015-08-07 09:06:41 +10:00
Nyall Dawson
728ead8a53 Avoid use of deprecated rotation field methods 2015-08-07 09:06:31 +10:00
Nyall Dawson
013e1da783 Tests and doxygen for QgsDataDefined 2015-08-07 09:05:47 +10:00
Matthias Kuhn
1e6483c6d1 Fix marker rotation
The rotation is no longer saved in the Qgs*SymbolRendererV2 but in the
QgsMarkerSymbolV2 in a QgsDataDefined. This commit fixes the legacy API and
redirects calls to the new API.
2015-08-07 08:47:52 +10: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
1b06c0c3b8 [server] Added comment 2015-08-06 18:03:49 +02:00
elpaso
d1b7bbee09 [server] Added comment to header 2015-08-06 18:00:24 +02:00