2677 Commits

Author SHA1 Message Date
Matthias Kuhn
58ea21124e Streamline expression context generation (#3350)
* Save more data to QML

 * Virtual fields
 * Map tips
 * Display expression
 * Read only flag

* Streamline expression context generation

Whenever an object is able to generate an expression context it
implements the method createExpressionContext() declared in
QgsExpressionContextGenerator.

This makes a cleaner API and allows using QgsFieldExpressionWidget and
QgsDataDefinedButton from python because standard OO programming
approaches are used instead of callbacks and void pointers.

* Colorize output of doc and sip tests

* Fix build

* Fix sip complaints

* Fix rebase problems

* Workaround failing bindings test
2016-08-10 19:44:30 +02:00
Juergen E. Fischer
b08a9e7951 rename test images 2016-08-10 12:12:28 +02:00
Juergen E. Fischer
3f22a7a77f another scripts/replacev2.sh with minor manual fixes 2016-08-10 12:12:28 +02:00
Juergen E. Fischer
d4bd17615b fix PyQgsSymbolLayer test 2016-08-10 12:12:28 +02:00
Juergen E. Fischer
2374f7978b TestQgsGeometry renames:
lineStringV2() to lineString()
pointV2() to point()
polygonV2() to polygon()
2016-08-10 12:12:28 +02:00
Juergen E. Fischer
eeebf4be08 rename QgsComposerSymbolItem::symbolV2() to symbol() 2016-08-10 12:12:28 +02:00
Juergen E. Fischer
39c4409c6a remove deprecated stuff from QgsVectorLayer and editor widgets 2016-08-10 12:12:28 +02:00
Juergen E. Fischer
0688621046 scripts/replacev2.sh run 2016-08-10 12:08:52 +02:00
Nyall Dawson
90fd4d4e64 Update TestQgsComposerLabel 2016-08-10 17:56:01 +10:00
Nyall Dawson
b160f101c2 QgsExpression::setGeomCalculator now takes a pointer
This allows the calculator to be cleared
2016-08-10 17:56:01 +10:00
Nyall Dawson
7da8110536 Remove deprecated methods from QgsExpression
Now all evaluate/prepare/etc methods must be called using QgsExpressionContexts

Also remove most remaining traces of special variables. This brings some
user facing changes, such that existing expressions may need to be
updated if they used these old special variables (eg $scale,
$feature). These changes are noted in doc/qgis3_user_changes.dox
so that we can include them in the release notes.
2016-08-10 17:55:06 +10:00
Nyall Dawson
863c73db8f Label test mask updates 2016-08-09 16:55:13 +10:00
Nyall Dawson
95ecdaf438 Reset layers for each pal placement test, avoids all tests failing
because of one
2016-08-09 16:55:12 +10:00
Nyall Dawson
c3f720f80b [pal] Only apply distance from line midpoint penalty to non closed linestrings
Sponsored by Andreas Neumann
2016-08-09 16:55:12 +10:00
Nyall Dawson
dc0cc32046 Further tweaks to line labeling, add tests
Sponsored by Andreas Neumann
2016-08-09 16:55:11 +10:00
Nyall Dawson
3b940fbbd0 [pal] Also prefer above -> below for parallel line placement 2016-08-09 16:55:11 +10:00
Nyall Dawson
01e6c04980 Labeling tests 2016-08-09 16:55:11 +10:00
Even Rouault
400a4d70a5 [QgsVectorFileWriter + OGR provider] Create Integer64 fields as Real fields when output driver doesn't support Integer64
Fix #15405
2016-08-08 15:53:19 +02:00
Even Rouault
4bcbc1e4e7 [WFS provider] Succesfully analyze DescribeFeatureType response with <complexType> as inline element of <element> (#15395) 2016-08-08 15:11:50 +02:00
Nyall Dawson
e72389601d Remove unused QgsRendererV2DataDefinedMenus
Was not exposed to python api, so not a PyQGIS api break
2016-08-07 11:19:32 +10:00
Nyall Dawson
87733851cf Followup 19ab72c, add unit test
Adds a unit test to ensure that all providers ignore invalid
ids when passed a FilterFids request.

Spoiler: they do
2016-08-06 08:16:09 +10:00
Denis Rouzaud
1db19ce8c0 Merge pull request #3356 from 3nids/remove_legendmodel
remove QgsLegendModel
2016-08-05 20:54:52 +02:00
Denis Rouzaud
bbb9b5322d remove QgsLegendModel 2016-08-05 20:53:58 +02:00
Matthias Kuhn
e82ce54a8e Don't rely on a particular order in filterFids tests (#3357) 2016-08-05 16:14:17 +02:00
Denis Rouzaud
acbf5cddb4 renamed QgsSymbologyV2Conversion to QgsSymbologyConversion 2016-08-05 08:32:13 +02:00
Denis Rouzaud
f2c3fb003e renamed QgsSymbolLevelsV2Dialog to QgsSymbolLevelsDialog 2016-08-05 08:22:43 +02:00
Denis Rouzaud
275736de92 removed V2 from QgsSymbolV2* 2016-08-05 08:22:21 +02:00
Denis Rouzaud
c16d1393a2 removed V2 from QgsSymbolLayerV2* 2016-08-05 08:18:01 +02:00
Nyall Dawson
1f02fd491d Implement provider side FilterFids iterators for OGR provider
Makes some operations with OGR sources magnitudes faster, ie
zoom to 20 selected features in a 4 million point dataset:

before: 14 seconds of blocked gui
after: instant

Win!
2016-08-05 07:40:54 +10:00
Nyall Dawson
ed4d34fdbc QgsFields returns QgsField value instead of const references
(since QgsField is implicitly shared)
2016-08-05 06:08:07 +10:00
Nyall Dawson
967d37adc7 QgsFeature::fields() returns a value, not a pointer
Also remove all other QgsFields pointers and replace with
references/values, since QgsFields objects are implicitly shared
2016-08-05 06:07:02 +10:00
Denis Rouzaud
3e197ae74a remove QgsColorButton in favor of V2 2016-08-04 14:27:31 +02:00
Matthias Kuhn
bb79d13e82 Remove deprecated Qgis::WKBType and API cleanup (#3325)
* Remove deprecated Qgis::WKBType and API cleanup

Renames QgsWKBTypes to QgsWkbTypes

Replaces usage of the enums:

* Qgis::WKBType with QgsWkbTypes::Type
* Qgis::GeometryType with QgsWkbTypes::GeometryType

Their values should be forward compatible (a fact that was already
explited up to now by casting between the types)

Renames some SSLxxx to SslXxx and URIxxx to UriXxx

* Fix build warnings and simplify type handling

* Add a fixer to rewrite imports

* The forgotten rebase conflictThe forgotten rebase conflicts

* QgsDataSourcURI > QgsDataSourceUri

* QgsWKBTypes > QgsWkbTypes

* Qgis.WKBGeom > QgsWkbTypes.Geom

* Further python fixes

* Guess what... Qgis::wkbDimensions != QgsWkbTypes::wkbDimensions

* Fix tests

* Python 3 updates

* [travis] pull request caching cannot be disabled

so at least use it in r/w mode

* Fix python3 print in plugins
2016-08-04 09:10:08 +02:00
Martin Dobias
9db9304627 Raster MTR improvements - part one (PR #3334) 2016-08-02 08:22:29 +02:00
Nyall Dawson
e259e62941 Merge pull request #3349 from nyalldawson/feature_geom
Mega API break - fix QgsFeature geometry getters/setters
2016-08-02 09:21:25 +10:00
Nyall Dawson
b7ca001c9c Add __nonzero__ and __bool__ methods to QgsGeometry 2016-08-02 08:39:58 +10:00
Martin Dobias
38b63edc46 Fix doc coverage test for "added in XXX" check 2016-08-01 23:05:37 +02:00
Matthias Kuhn
ea0f4da58c Sort attribute table by value for numerical columns
Fix #15318
Fix #15295
2016-08-01 16:31:16 +02:00
Nyall Dawson
4b78b1c208 Make all QgsGeometry methods return values, not pointers
Reduces likelihood of crashes and leaks
2016-08-01 22:41:55 +10:00
Matthias Kuhn
3e33e686c1 Rename visibility presets to map themes
Because it is not only more descriptive for what it does but also
sounds more interesting.

[needs-docs]
2016-08-01 12:23:44 +02:00
Nyall Dawson
bd7d913379 Refine QgsFeature geometry getters/setters
All pointer based methods have been removed.

Now we have only:

  void setGeometry( const QgsGeometry& geom )

and

  QgsGeometry geometry() const

Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing #777, which
has survived for over 9 years!...

Impacts on PyQGIS code:
- no more need for the messy
  g = QgsGeometry( feature.geometry() )
  workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
 using `if f.geometry():`, since QgsFeature::geometry() will
 *always* return an object. Instead, use
 `if not f.geometry().isEmpty():`, or preferably the new method
 `if not f.hasGeometry():`

Fix #777
2016-08-01 16:25:46 +10:00
Nyall Dawson
aceddae65a QgsFeature cleanup, part 1
Deprecate some QgsFeature methods which take or return pointers,
update other classes as required
2016-07-31 21:23:07 +10:00
Nyall Dawson
429fe2d4ce Merge pull request #3335 from nyalldawson/vector_layer
QgsVectorDataProvider::Capability improvements
2016-07-29 05:10:37 +10:00
Nyall Dawson
10c92394e7 [FEATURE] API + expression function for merging linestrings
Adds a new method to QgsGeometry for merging linestrings.
By passing a multilinestring, any connected lines will
be joined into single linestrings. Behind the scenes this
uses GEOS' line merge.

A corresponding expression function "line_merge" has also
been added.
2016-07-28 20:33:27 +10:00
Nyall Dawson
1a4ceb1680 [FEATURE] Expression function for calculating geometry boundary
The new 'boundary(...)' function returns a geometry's topological
boundary, ie for polygons this is a multilinestring representing
the polygons rings
2016-07-28 08:16:57 +10:00
Nyall Dawson
85f37eebb3 Add method to QgsAbstractGeometryV2 for boundary
Returns the closure of the combinatorial boundary of the
geometry (ie the topological boundary of the geometry).
For instance, a polygon geometry will have a boundary
consisting of the linestrings for each ring in the polygon.

Follows OGC / SQL/MM specs for boundary calculation
2016-07-28 08:16:57 +10:00
Nyall Dawson
6c0d97a06b Merge pull request #3337 from nyalldawson/remove_psuedo_shader
Remove the broken, unused QgsPseudoColorShader class
2016-07-27 07:11:55 +10:00
Nyall Dawson
3d6688cce5 Add labeling tests for letter/word spacing 2016-07-27 06:37:16 +10:00
Nyall Dawson
5228de353c Update curved label test reference images 2016-07-27 06:37:16 +10:00
Nyall Dawson
68b621ace6 Merge pull request #3314 from nyalldawson/units
Consolidate unit handling in QgsUnitTypes
2016-07-26 11:14:35 +10:00