28 Commits

Author SHA1 Message Date
Nyall Dawson
b7e1cae4f0 Switch double quoted single character to single quotes for some
QString methods

Using single quotes is a significant performance boost. Rough
benchmarks indicate the QString single quote methods take
about 15% of the time the double quote variants take.
2015-11-02 17:55:08 +11:00
Nyall Dawson
9a94132fb4 Clazy issues:
- use at() instead of [] for temporary containers (at() returns
const reference, so it avoids the detach which occurs with [])
- use at( 0 ) rather than first() for containers, because first()
detaches (Qt5 introduced constFirst()/constLast() to overcome this)
2015-10-20 20:36:08 +11:00
Nyall Dawson
d1be2ff214 Fix hardcoded border for raster legend items (fix #13540)
Previously raster legend items always had a fixed black border.
Now there's options to change the color/width of this border or
disable it entirely.
2015-10-09 06:12:37 +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
Nyall Dawson
f628ebd423 Replace foreach with Q_FOREACH
For:
- consistency
- to make it immediately clear that this is a Qt macro and that it
works slightly differently to c++ for loops
2015-09-09 19:17:29 +10:00
Nyall Dawson
0c5475545f Cleanup control_images folder by grouping some tests in subfolders 2015-08-30 20:15:25 +10:00
Nyall Dawson
405688ea49 [tests] Add method for setting size tolerance to render checker,
add some size tolerance to legend renderer test
2015-07-10 16:52:52 +10:00
Juergen E. Fischer
12b7831175 remove unused iostream header 2015-07-05 16:51:29 +02:00
Juergen E. Fischer
f92d9c1176 but not with QString (followup 34c1c8d) 2015-07-03 12:30:19 +02:00
Juergen E. Fischer
34c1c8dc58 avoid auto 2015-07-03 11:53:17 +02:00
Juergen E. Fischer
9b976cfe26 test cleanups and some fixes 2015-07-02 04:22:52 +02:00
Hugo Mercier
bb6bff0bca Merge pull request #2183 from mhugo/master
Add unit test for QgsLayerTreeModel::setLegendFilterByMap()
2015-06-30 11:27:19 +02:00
Hugo Mercier
a9c63968bf Add unit test for QgsLayerTreeModel::setLegendFilterByMap() 2015-06-30 10:39:36 +02:00
Denis Rouzaud
9e3183c63f Revert "sort includes"
This reverts commit 2b7d3d3c73b50ba6dc74abec6dd652ff1b87c0ec.
2015-06-10 14:54:47 +02:00
Denis Rouzaud
2b7d3d3c73 sort includes 2015-06-10 13:59:08 +02:00
Nyall Dawson
4e0431d88b Coverity fixes (unchecked dynamic_cast) 2015-02-11 17:12:44 +11:00
Juergen E. Fischer
0f9397028e fix more cppcheck issues 2015-02-07 18:40:42 +01:00
Nyall Dawson
cb5ef020f3 Avoid 'array compared against 0' error for QgsRasterLayer constructor
... by explicitly passing QString arguments. Otherwise the string
literals are implictly converted to bool and the wrong constructor
is called.

This is not an ideal solution as the API is still misleading, but I
can't see an alternative solution without breaking API and making
one of the constructors explicit or changing their signature.
2015-02-04 17:18:35 +11:00
Matthias Kuhn
78c519546a Add Qt5 support 2014-11-21 11:45:32 +01:00
Matthias Kuhn
1c2bdf1ea3 Switch tests to automoc
Required for Qt5 compatibility
Raises minimum CMake version to 2.8.6
2014-11-04 09:18:26 +01: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
Juergen E. Fischer
869c906999 indentation update, Q_FOREACH support in astyle, doxygen fix 2014-09-01 09:39:33 +02:00
Martin Dobias
812f671f82 Legend customization via layer node's custom properties
This allows for reordering, renaming and removal of legend nodes.
Composer either uses default project layer tree (auto-update on)
or customized layer tree (auto-update off).
2014-09-01 10:10:37 +07:00
Martin Dobias
8dba8af60d Support for custom labels in symbol-v2 legend node 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
Martin Dobias
4fa1f45d56 Creation of legend items for map layers moved to QgsMapLayerLegend 2014-09-01 10:10:35 +07:00
Martin Dobias
fda50ede01 Move bits of legend rendering code into item classes + add rendering test 2014-09-01 10:10:35 +07:00