56 Commits

Author SHA1 Message Date
Martin Dobias
645514a23b Remove setLayerName(), layerName() from QgsLayerTreeLayer
(replaced by setName(), name() overridden from the parent)
2016-11-15 00:56:22 +08:00
Martin Dobias
9950b085d4 Fix missing docs and sip coverage (followup 968e02d6) 2016-11-14 23:39:58 +08:00
Martin Dobias
968e02d6fe Propagate layer/group name changes in the layer tree (fixes #15844) 2016-11-14 19:57:00 +08:00
Matthias Kuhn
4981bfcf18 Fix memory leak 2016-11-11 16:55:57 +01: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
44289084e9 Optimise passing of variables by ref/value 2016-10-24 10:36:23 +10:00
Nyall Dawson
bc30cdf41d Followup c9251c, fix crash 2016-10-20 17:32:39 +10:00
Nyall Dawson
c9251c5793 Avoid creating multiple render contexts when calculating legend
node size

Partial fix for qgis slowdown when using layer with large
number of legend nodes
2016-10-20 07:50:41 +10:00
Nyall Dawson
fe65063c2b Remove many deprecated methods 2016-09-15 18:34:15 +10:00
Juergen E. Fischer
0688621046 scripts/replacev2.sh run 2016-08-10 12:08:52 +02:00
Denis Rouzaud
275736de92 removed V2 from QgsSymbolV2* 2016-08-05 08:22:21 +02:00
Nyall Dawson
4cfacf14e3 Make API more consistent
- rename methods with XML to Xml, CRS to Crs, WMS to Wms, ID to Id
- rename methods with SRS to Crs
- rename methods with abbreviations like "dest" to "destination"
- rename methods with abbreviations like "src" to "source"
2016-07-21 08:40:50 +10:00
Matthias Kuhn
95f81391d3 sip bindings 2016-06-03 15:13:42 +02:00
Nyall Dawson
3b4638ab83 Followup 01f615d 2016-03-10 07:43:25 +11:00
Patrick Valsecchi
a112dfe63e Make out of range layers greyed out in the tree 2016-03-09 09:56:15 +01:00
Nyall Dawson
c3a57434d9 Fix clazy 'pass small and trivially-copyable type by value' warnings 2016-02-02 19:47:21 +11:00
Nyall Dawson
c7204cc722 Fix editing composer legend titles while filtering enabled (fix #11459) 2016-01-27 15:51:47 +11:00
Hugo Mercier
bbf2137940 Allow to filter joined fields with a virtual layer 2016-01-07 16:34:34 +01:00
Nyall Dawson
881074b194 Boost coverage of SIP bindings
Now all classes and members are either exposed to bindings or marked
as "not available in Python bindings" in the docs.

Drop test thresholds to 0. Now it should be much easier to determine
what missing members have been added which are causing test
failures.
2016-01-05 11:16:15 +11:00
Nyall Dawson
6e140b97fd [FEATURE] Edit legend symbols directly from layer tree
This adds a new "edit symbol" item to the right-click menu for a
renderer child legend item (eg categories for the categorised
renderer). Selecting it opens a symbol editor dialog which allows
for directly editing the classes symbol. It's much faster than
opening the layer properties and going through the style tab.
2015-12-09 07:25:03 +11:00
Nyall Dawson
83e139a550 Add method for retrieving legend nodes by layer ID and legend rule key 2015-12-09 06:01:12 +11:00
Nyall Dawson
91f7918e21 [FEATURE] Add a show/hide all context menu for layer tree symbol items
Allows toggling on/off all the symbol items for categorized/graduated/
rule based layers via the right click menu on an item. Previously
you'd have to manually toggle each item one-by-one.

Fix #13458
2015-12-07 07:39:20 +11:00
Nyall Dawson
cdf21b7c3e Return derived classes from clone() methods, avoids need to
dynamic_cast results
2015-11-12 20:29:06 +11:00
Hugo Mercier
d16cdcf449 Add more options for filtering legend elements
This introduces two new options to filter legend elements:
- filter by expression: a boolean expression can be set. Only symbols of
features that make the expression evaluated to true will be kept in the legend
- filter by polygon: only symbols of features that are inside the given
polygon will be part of the legend.

The polygon filtering is used in particular for a new option in the
composer legend that allows to filter out anything that is not included
in the current atlas polygon.
2015-11-03 10:39:09 +01:00
Nyall Dawson
f1633a1796 Change all signals to use const refs for non trivial objects 2015-10-26 22:46:25 +11:00
Nyall Dawson
c49b5b777f Change a lot of arguments to const references in core/gui
Rationale:
- there was a lot of large objects passed by value, so potentially
there's a speed bump from this
- even for implicitly shared classes like QString/QList there's still
a (small) cost for copying the objects when there's no reason to
- it's the right thing to do!
2015-10-07 12:02:04 +11:00
Juergen E. Fischer
2a1cacd5f4 defer legend invalidation to avoid reprocessing when multiple layers are involved 2015-09-21 21:25:19 +02:00
Martin Dobias
50d4e720a7 [FEATURE] Mutually exclusive layer tree groups (only one child may be checked at a time)
The feature can be toggled individually for groups - in layer tree view context menu.

This code has been funded by Tuscany Region (Italy) - SITA (CIG: 63526840AE) and commissioned to Gis3W s.a.s.
2015-09-21 19:30:15 +08:00
Martin Dobias
205daae008 Support overriden layer styles also in the composer legend 2015-05-26 18:59:30 +07:00
vmora
d13ace5a0d Allow configurable icon sizes for legend tree nodes 2015-05-12 09:40:23 +02:00
Nyall Dawson
4a9a9361aa Fix legend text not customisable for QgsSimpleLegendNode items 2015-05-04 16:34:30 +10:00
Juergen E. Fischer
ee50520a52 fix leak on loading layer definition (also fixes #12064) 2015-02-09 11:46:00 +01:00
Juergen E. Fischer
abd4a04399 sip update 2015-02-03 02:21:52 +01:00
Martin Dobias
aacb1bdf3e Save and restore expanded state of legend nodes in tree hierarchy 2015-01-22 13:42:31 +07:00
Martin Dobias
3d539c8cd3 [FEATURE] Show rule-based renderer's legend in a tree hierarchy
The functionality can be used in other renderers too, the only requirement
is that legend nodes need to specify their parent rule key via data().

Note that ayer tree model must have ShowLegendAsTree flag enabled, otherwise
the model will keep showing lists instead of trees.
2015-01-22 13:42:31 +07:00
Juergen E. Fischer
b49da36c7f * Save and restore visiblity state of embedded group layers (fixes #4097)
* Adds support for lists in custom properties
2015-01-13 14:55:03 +01:00
Juergen E. Fischer
d4f64d9bde indentation update and typo fixes 2014-11-13 23:13:13 +01:00
Martin Dobias
cc306099d9 Fix #11474 (cannot move layers in layer tree anymore)
I have managed to break that with implementation of #11369.
Obviously it is a bad idea to change selection in a slot connected to model's rowsInserted signals
because the drag'n'drop does not work properly anymore. Now registry bridge will emit a signal after
new layers have been added, so the selection change at that point should be safe.
2014-10-23 19:08:54 +07:00
Juergen E. Fischer
67e077853e DXF export improvements:
* tree view and attribute selection for layer assigment in dialog
* support fill polygons/HATCH
* represent texts as MTEXT instead of TEXT (including font, slant and weight)
* support for RGB colors when there's no exact color match
* use AutoCAD 2000 DXF (R15) instead of R12
* remove R18 test methods

Funded-By: City of Uster
Funded-By: Ville de Morges
Funded-By: SIGE
2014-09-26 14:10:26 +02:00
rldhont
251a8a4d3a [FEATURE][QGIS-Server] Legend filtering based on map in GetPrint Request
Feature funded by Tecnostudi Ambiente, Faunalia and Andromede-oceanologie.

The legend in composition was fixed and did not represent the layers in the map.
With the work made by @wonder-sk on layer-tree and QgsComposerLegend users will be able
 to configure composer legend as based on all the project layer tree with auto-update
 model or filtered by map.
This commit reused these two QgsComposerLegend's properties to filter it based on map in
 GetPrint Request

The issue #4003 qgis_mapserver getPrint legend options can be closed.
2014-09-26 12:09:40 +02:00
Martin Dobias
e37a5ad8df [FEATURE] Legend filtering based on map content (in main window, composer, WMS)
There is new "filter" button in layers panel that toggles this functionality
and in composer legend widget.

Related feature is that layer tree now shows symbols in map units with correct size
(even when filtering is not enabled) so as the map view changes the legend node icons
are updated too (if they use map units).

GetLegendGraphics in WMS server
-------------------------------

This is an extension of standard GetLegendGraphics request according to MapServer RFC 101.
See the document for more details: http://mapserver.org/development/rfc/ms-rfc-101.html

In summary, clients need to add BBOX and CRS/SRS parameters to get appropriate legend based on the given map view.
Parameters WIDTH and HEIGHT are also taken into account as they specify map view image size for correct calculation
of size of legend symbols (if they are based on map units).

--

This software has been commissioned by Tuscany Region (Italy),
co-funded by the European Commission and developed under the project LIFE12 ENV/IT/001054 LIFE + IMAGINE.
The software has been realized by Gis3W s.a.s.

Questo software è stato commissionato da Regione Toscana (Italia),
cofinanziato dalla Commissione Europea e sviluppato nell'ambito del progetto LIFE12 ENV/IT/001054 LIFE + IMAGINE.
Il software è stato realizzato da Gis3W s.a.s.
2014-09-25 12:56:37 +02:00
Martin Dobias
86b4fcc7be Fix QgsLayerTreeModel naming conventions and update Python bindings
I was using a mixture of terms 'symbology items' and 'legend nodes' for the same thing which was confusing
2014-09-05 18:33:55 +07:00
Martin Dobias
4cac2f75bd Visibility groups: also record visibility states of renderer categories (legend nodes) into groups
Visibility of a layer is not stored within the map layer, but visibility
of renderer categories (which turn into legend nodes) is stored inside renderer and
that one in turn inside map layer. This fact may result in surprising behavior
when change of visibility group for a composer map will affect other composer maps (and main canvas).
The only way to overcome the problem would be to have the possibility to use multiple renderers with one layer.
2014-09-05 11:28:08 +07:00
Martin Dobias
dd78f099ab Fix doxygen warnings, fix missing bindings 2014-09-01 11:05:51 +07:00
Martin Dobias
68ed52e963 API fixes, added missing python wrappers 2014-09-01 10:10:37 +07:00
Martin Dobias
e6c6aa2137 Layer tree model support replacement of layer tree + layer node handles removal of layer cleanly 2014-09-01 10:10:36 +07:00
Martin Dobias
0fc7fc7b07 New flag to disable checkboxes for legend nodes in layer tree model 2014-09-01 10:10:36 +07:00
Martin Dobias
89941f6b0a Moved QgsLayerTreeModelLegendNode (+derived classes) to a new file 2014-09-01 10:10:36 +07:00
Martin Dobias
6891aae19a Use QgsLayerTreeModel as a source of data for legend rendering instead of QgsLegendModel
This is work in progress, customization of legend is not working yet
2014-09-01 10:10:36 +07:00
Juergen E. Fischer
07165eae79 indentation update 2014-08-17 13:37:34 +02:00