1270 Commits

Author SHA1 Message Date
Martin Dobias
5266fd97ee [FEATURE] Composer map - optionally store layer styles
There is a new check box that allows the user to tell whether a map should
keep the layer styles (it will store the state when the check box is checked).
The stored layer styles keep a snapshot of each layer's configuration
instead of just keeping name of the style.

This solves issues with styles and visibility presets in composer which were
not completely compatible.

This code has been funded by Tuscany Region (Italy) - SITA (CIG: 6002233F59)
and commissioned to Gis3W s.a.s.
2015-01-19 15:18:55 +07:00
Juergen E. Fischer
2b58df4d3c add missed files (followup 313f2c8d) 2015-01-16 08:55:00 +01:00
Nyall Dawson
0e354957b5 Add overrides pt 2 2015-01-15 22:25:17 +11:00
Nathan Woodrow
d9042f590f Follow up 6a17a60ae2 - Fix error when passing usesgeometry to qgsfunction 2015-01-10 10:43:12 +10:00
Sandro Santilli
e2e47d71c6 Add rotate and transform(QTransform) methods to QgsGeometry
Reimplement translate in terms of transform(QTransform).
Includes new unit test for rotate() and translate() methods.
Includes sip bindings update.
2015-01-09 12:37:00 +01:00
Martin Dobias
8b5587fe13 Improve the internals of map layer style manager
- style manager is always enabled (client code does not need to distinguish between enabled/disabled state)
- layers currently active style is stored only in QgsMapLayer - in style manager it has entry with no data (avoids duplication of data)

This also solves issues with visibility presets and styles when some presets do not have stored style
2015-01-09 17:04:26 +07:00
Martin Dobias
603b3a5248 Fixed problems with style switching not always working correctly
Caused by internal storage (QByteArray) not re-adjusting its size
to new content, resulting in corrupted XML data
2015-01-08 12:08:13 +07:00
Martin Dobias
3ce9c70cc4 Merge pull request #1755 from wonder-sk/multiple-styles
[FEATURE] Support for multiple styles per map layer

Available in legend context menu in Styles sub-menu where it is possible to add/remove styles
and quickly switch between them.
2015-01-07 21:50:25 +07:00
Martin Dobias
f00f4fd7cd Style manager code cleanups 2015-01-07 19:55:25 +07:00
Martin Dobias
829f99b0b8 Initial core work on multiple styles per layer 2015-01-07 14:17:18 +07:00
Matthias Kuhn
df2cac7640 Merge pull request #1743 from naihil/master
[Qt5-compat] Change Q_WS_* macroses to Q_OS_*
2015-01-05 09:56:15 +01:00
Juergen E. Fischer
841af773e3 remove (outdated) internal spatialite 2015-01-04 16:18:01 +01:00
Juergen E. Fischer
6f8f66eb49 indentation update 2015-01-03 01:50:39 +01:00
rldhont
a0ffad2532 [FEATURE] Add get and transform geometry in Expression
In version 2.6, new keywords has been added to Expression :
* $currentfeature - returns the current feature
* $atlasfeature - returns the atlas feature
* getFeature - gets a matching feature from a layer

But I think, Expression lacks a few keywords :
* geometry - returns the feature's geometry
* transform -  returns the transformed geometry

These new keywords can be used with getFeature for some geometry tests like
 intersects, crosses, contains, etc

Tests has been added to geometry and transform in Expression
2015-01-02 12:02:55 +01:00
Juergen E. Fischer
bff64fdef9 indentation update 2014-12-30 22:47:09 +01:00
Julien Nabet
e6561cec68 Fix cppcheck reports:
[src/providers/ogr/qgsogrprovider.cpp:1071]: (error) Memory leak: oldlocale
[src/providers/ogr/qgsogrprovider.cpp:1268]: (error) Memory leak: oldlocale
[src/core/spatialite/spatialite.c:50598]: (error) Memory leak: reader
[tests/src/core/testqgscolorscheme.cpp:155]: (error) Memory leak: dummyScheme2
[src/core/spatialite/spatialite.c:40138]: (error) Memory leak: ln
2014-12-30 22:47:08 +01:00
Anatoliy Golubev
d5d4a5adeb Q_WS_* macros removed from Qt5, to determine platform use Q_OS_* macroses which exists in Qt4 and Qt5 2014-12-23 12:34:21 +03:00
Nathan Woodrow
d61bf1f70f Add lazy evaluation support to expression functions
Add if(cond, true, false) function using lazy evaluation feature
2014-12-13 15:33:09 +10:00
Radim Blazek
69b27f04be ziplayertest fix 2014-12-12 19:27:41 +01:00
Denis Rouzaud
ea33122a54 expression: more comments and test to avoid differences between operators declaration and text values 2014-12-12 15:28:57 +01:00
Sandro Santilli
917cee0510 Consider map rotation in rendering of horizontal and parallel labels
See http://hub.qgis.org/issues/11814

NOTE: the map rotation should likely be considered at LabelPlacement
      configuration rather than at rendering time

Raises pixel mismatch tolerance for background labels tests
2014-12-12 11:22:32 +01:00
Sandro Santilli
bd4087b4d3 Tweak tolerances for CanvasPoint and ComposerPdfPoint PAL tests
.. to succeed on Ubuntu 14.04.1 LTS
2014-12-12 11:09:24 +01:00
Nyall Dawson
bcc29ff5d0 Add methods to QgsDataDefined for reading and writing to XML 2014-12-10 19:53:16 +11:00
Sandro Santilli
87de9f5b92 Test rotation API in QgsMapPixel unit test 2014-12-09 12:10:32 +01:00
Sandro Santilli
ec085bfbcc Add unit test for QgsMapToPixel (legacy only for now) 2014-12-09 11:29:05 +01:00
Nyall Dawson
fd0e98d5f4 Ensure all items are deleted from TestQgsComposerTableV2 2014-12-09 19:20:16 +11:00
Nyall Dawson
7ca723920f Merge pull request #1721 from nyalldawson/integer_divide
[expressions] Make int/int return double results
2014-12-09 18:37:48 +11:00
Sandro Santilli
ce8a9ba4af Add support for map rotation (hub #9330)
Includes widget to show and set map rotation.
Handle rotation in vector and raster renderers.
Ensure correct behavior of panning and zooming actions.

Drop compile-time defines for ARM and ANDROID, leaving only
the qreal based function to transform in place.

Update expected test results after eye comparison.
2014-12-07 16:30:41 +01:00
Nyall Dawson
232aaaca66 [expressions] Make int/int return double results.
Also add a new "//" operator to perform integer division.
(fix #5153)
2014-12-06 16:36:42 +11:00
Nyall Dawson
697ef510b7 Also evaluate expressions entered in QgsSpinBox
and flip all composer spin boxes to QgsSpinBox (refs #10544)
2014-12-05 23:39:50 +11:00
Nyall Dawson
7400106e41 [FEATURE] Evaluate expressions entered in QgsDoubleSpinBox
Allows entry of QGIS expressions into the spin box. The expression
is evaluated on enter or loss of focus and then discarded.

(refs #10544)
2014-12-05 20:39:09 +11:00
Nyall Dawson
ad32bbf40c Add some atlas reference images for precise (part 2) 2014-12-03 21:58:52 +11:00
Nyall Dawson
b07e4db27b Add some atlas reference images for precise (part 1) 2014-12-03 21:23:25 +11:00
Nyall Dawson
3e6d784a62 Try increasing color tolerance for composer tests slightly 2014-12-03 19:44:13 +11:00
Martin Dobias
b278ea1a93 API: Added support for bulk loading of spatial index
This is much faster way of initializing a spatial index. From python it is as simple as
>>> index = QgsSpatialIndex( layer.getFeatures() )

From a simple test with 50K points in a memory layer:
- bulk loading ~ 100 ms
- inserting features ~ 600 ms

The index tree should be in theory also better constructed and may result in faster lookups.
2014-12-03 10:59:28 +07:00
Nyall Dawson
0f761949b8 Fix calculation of smart breaks when html has transparent background
Should finally fix troublesome composer html tests
2014-12-02 12:11:21 +11:00
Nyall Dawson
d815ac0061 Try to fix some more intermittent composer tests 2014-12-01 20:30:39 +11:00
Nyall Dawson
118a9f63dc Add some missing exitQgis() calls to unit tests
Also ensure that compositions are deleted before exiting
Qgis during tests.
2014-12-01 19:52:04 +11:00
Nyall Dawson
48edab4fe6 Hopefully fix intermittently failing composer html test 2014-12-01 19:28:50 +11:00
Matthias Kuhn
7d8a3b1a29 Change unary minus test --1 to -(-1)
See http://lists.osgeo.org/pipermail/qgis-developer/2014-November/035835.html
2014-11-30 10:34:19 +01:00
Matthias Kuhn
77e62b97c1 Add line comments to QgsExpression
Delimited by double-minus and EOL/EOF

Example:
  $id -- This is the feature id
2014-11-30 10:34:19 +01:00
Matthias Kuhn
13255b13ae Add block comment tests 2014-11-30 10:34:18 +01:00
Nyall Dawson
d532af0b33 Add some test images and tweak test tolerances for utopic 2014-11-29 14:51:55 +11:00
Nyall Dawson
20f57c90d9 [composer] Make html tests text-free
Minimises cross platform rendering differences
2014-11-29 11:50:18 +11:00
Nyall Dawson
2ec4c2abd3 Regenerate incorrect test images and reenable atlas tests for travis 2014-11-25 06:13:19 +11:00
Matthias Kuhn
cae6baea90 Formatting of tests 2014-11-21 11:45:33 +01:00
Matthias Kuhn
95f6483855 Fix some race condition segfaults of tests on exit 2014-11-21 11:45:32 +01:00
Matthias Kuhn
78c519546a Add Qt5 support 2014-11-21 11:45:32 +01:00
Juergen E. Fischer
a57066a48d * fix cppcheck warnings
* some sip updates
* [API] fix spelling QgsMultiRenderChecker::drawBackround
* [API] fix spelling QgsSymbolLayerV2Utils::drawStippledBackround
* [API] fix spelling QgsMapSettings::layerTransfrom
2014-11-20 15:02:35 +01:00
Nyall Dawson
44a334b095 Add hasDefaultValues method to QgsDataDefined, add some tests 2014-11-20 21:28:34 +11:00