85 Commits

Author SHA1 Message Date
Matthias Kuhn
f33aabd90a Completely move layer order to core 2017-03-23 15:29:12 +01:00
Nyall Dawson
b6c76186b4 Restore opening existing composers 2017-03-21 10:32:53 +10:00
Nyall Dawson
6cfc6a1b98 Allow retrieval of project layer order through QgsProject
Previously this was only accessible through app
2017-03-13 12:52:55 +10:00
Matthias Kuhn
7dbe4943d6 Notify about QgsProject::crs changes 2017-03-06 18:06:11 +01:00
Juergen E. Fischer
a10c890383 More QgsSettings updates:
* revives WMS
* QgsSettings::clear() added
* section added to QgsSettings::contains()
* type parameter added to sip binding of QgsSettings.value()
* TODO: customization & evis
2017-03-04 02:37:59 +01:00
Denis Rouzaud
5176ecf597 [needs-docs] keyboard shortcut to toggle snapping (S)
Pressing the key "S" will toggle snapping. This helps to quickly
enable/disable snapping while digitizing.
2017-02-28 12:13:41 +01:00
Matthias Kuhn
382b213ed1 Remove "the"-prefix from method signatures 2017-02-20 08:45:54 +01:00
Martin Dobias
5f5c1ddb15 Use a path resolver class instead of QgsProject::instance() in map layers
A new class QgsPathResolver is introduced for conversion between absolute
and relative paths when reading/writing XML.

Cleaned up code in layer definition file support (.qlr) to better handle
relative/absolute path conversion.
2017-02-16 09:56:11 +08:00
Denis Rouzaud
f85ac23cde fix version in added note 2017-01-31 10:03:33 +01:00
Nyall Dawson
4058f4734b Annotations are now handled at a project level
This commit implements a new QgsAnnotationManager class, which
handles storage, writing and retrieval of annotations.

QgsProject has an annotationManager() attached to it. Map canvases
sync their visible QgsMapCanvasAnnotationItems to the annotations
contained within the project's annotation manager.

This moves all management, storage and retrieval of annotations
up to core and out of app/canvas.
2017-01-30 14:57:16 +10:00
Martin Dobias
0513bb357c Make QgsGeometry independent from QgsProject + better avoid intersections API 2017-01-07 11:50:08 +08:00
Martin Dobias
46252b5cd0 fix doxygen warning 2017-01-04 20:58:21 +08:00
Martin Dobias
6c5956b22b QgsProject: cleanup of read/write method + removal of unused bad layer handler class 2017-01-04 20:29:53 +08:00
Harrissou Sant-anna
ef85cdcf83 Replace "eg" by "e.g." or "for example" 2016-12-30 00:03:22 +01:00
Matthias Kuhn
33abb78ac5 Pass variable values as QVariant 2016-12-22 20:21:21 +01:00
Matthias Kuhn
79f32ab6b2 Rename QgsProject::variables to QgsProject::customVariables 2016-12-22 20:21:21 +01:00
Matthias Kuhn
cbac49b63b Add QgsProject::write( filename ) convenience function 2016-12-21 17:39:58 +01:00
Martin Dobias
57ff36bc01 Make it possible to use project as non-singleton
This is just a first step - it will be a long way to get rid of all
the usages of singleton instance in QGIS code.
2016-12-11 17:49:24 +08:00
Martin Dobias
d56a97d4fe Merge QgsMapLayerRegistry into QgsProject
All methods/signals of QgsMapLayerRegistry moved verbatim to QgsProject.
2016-12-10 15:18:12 +08:00
arnaud.morvan@camptocamp.com
a8d9dea1fb Add QgsExpressionContextGenerator inheritances in sip 2016-11-06 17:58:54 +01:00
Nyall Dawson
44289084e9 Optimise passing of variables by ref/value 2016-10-24 10:36:23 +10:00
Matthias Kuhn
96a649e37f Add missing bindings 2016-10-23 21:14:42 +02:00
Matthias Kuhn
54b953f433 Cleanup and modernize QgsProject code 2016-10-23 20:54:41 +02:00
Matthias Kuhn
85c105d6b0 Move management of avoidIntersectionLayers to QgsProject 2016-10-20 12:56:35 +02:00
Matthias Kuhn
5c919fbcca Move topological editing setting management fully to QgsProject 2016-10-20 12:56:35 +02:00
Denis Rouzaud
64d3c788f1 Use toolbar or status bar for snapping config 2016-10-20 12:56:35 +02:00
Matthias Kuhn
e0fc641402 Show commit errors in transaction mode 2016-10-18 15:47:42 +02:00
Nyall Dawson
ecee43814a Fix changing project CRS from legend doesn't correctly set CRS
Also avoid fragile duplicated code for setting/retrieving
common project properties

Fixes #15717
2016-10-18 09:55:56 +10:00
Nyall Dawson
fe65063c2b Remove many deprecated methods 2016-09-15 18:34:15 +10:00
Matthias Kuhn
bcae877fab Fix doxygen 2016-08-19 16:53:54 +02:00
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
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
f6f5010131 Move QGis::UnitType to QgsUnitTypes::DistanceUnit
This change consolidates more unit handling and conversion into
QgsUnitTypes.

Additionally, UnknownUnit was renamed to UnknownDistanceUnit.
All methods which accepted QGis::UnitType parameters have been
updated to take QgsUnitTypes::DistanceUnit instead.

ALso remove the unit handling methods toLiteral, fromLiteral, tr,
fromTr, and fromUnitToUnitFactor from QGis. Their corresponding
counterparts in QgsUnitTypes should be used instead.
2016-07-25 14:47:16 +10:00
Nyall Dawson
1a2231f10c Rename QGis class to Qgis, for capitalisation consistency 2016-07-21 22:01:38 +10:00
Nyall Dawson
c7ffdfa5e9 Make sure variable editor widgets always show current variables
On behalf of Faunalia, sponsored by ENEL
2016-07-19 12:00:35 +10:00
Nyall Dawson
4145e337ab Add missing SIP bindings 2016-07-11 08:42:52 +10:00
Nyall Dawson
3a34368efb Cleanup qgsproject.h/.cpp
- Conslidate doxygen in qgsproject.h
- Remove TODOs from docs, move to comments
- Cosmetic formatting changes to match QGIS standards
- Remove doxygen groups (we sort doxygen by name now)
- Clarified and improved some docs
- Remove mega outdated XML samples
2016-06-14 10:24:20 +10:00
Matthias Kuhn
95f81391d3 sip bindings 2016-06-03 15:13:42 +02:00
Sandro Mani
bded2b518c Remove QgsBillboardRegistry 2016-06-03 12:58:03 +02:00
Sandro Mani
3e73064c4a Store QgsBillBoardRegistry in QgsProject instead of making it a singleton 2016-05-28 17:10:10 +02:00
Matthias Kuhn
4586a787b0 Move AutoTransaction setting to project properties
Was in global app settings
2016-04-06 12:17:38 +02:00
Matthias Kuhn
9c0a291046 Deprecate QgsProject::dirty( bool ) in favor of QgsProject::setDirty 2016-04-05 14:47:56 +02:00
Matthias Kuhn
54219c571f Centralize handling of non-identifiable layers in QgsProject 2016-03-29 08:27:53 +02:00
Juergen E. Fischer
5c4bf99ce2 debian packaging update: manually merge some changes from PR#2818 and
some spelling fixes.
2016-02-20 16:55:16 +01:00
Nyall Dawson
dfdcec8922 Fix project unit confusion (pt 3): add area unit settings with a
ton of available area units (eg m2, km2, mi2, ft2, yd2, ha, ac,
etc)

Adds a new option in both the QGIS setting and project properties to
set the units used for area measurements. Just like the distance
setting, this defaults to the units set in QGIS options, but can
then be overridden for specific projects.

The setting is respected for area calculations in:
- Attribute table field update bar
- Field calculator calculations
- Identify tool derived length and perimeter values

Also adds unit tests to ensure that area calculated by attribute table
update bar, field calculator and identify tool are consistent wrt
ellipsoidal calculations and area units.

TODO: make measure tool respect area setting

(refs #13209, #4252 and fixes #12939, #2402, #4857)
2016-02-15 12:47:36 +11:00
Nyall Dawson
ddbdcf8ab1 Fix project unit confusion (pt 2): add project distance unit setting
Adds a new option in project properties to set the units used for
distance measurements. This setting defaults to the units set in
QGIS options, but can then be overridden for specific projects.

The setting is respected for length and perimeter calculations in:
- Attribute table field update bar
- Field calculator calculations
- Identify tool derived length and perimeter values
- Default unit shown in measure dialog

Also adds unit tests to ensure that length and perimeter calculated
by attribute table update bar, field calculator and identify tool
are consistent wrt ellipsoidal calculations and distance units.

(refs #13209, #12939, #2402, #4857, #4252)
2016-02-14 21:04:41 +11:00
Juergen E. Fischer
a90be95f7b sip sync 2016-02-14 03:50:49 +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
Matthias Kuhn
d795e508cc Merge pull request #469 from olivierdalang/SanitizeEntryNames
Warning about invalid entry names
2015-11-20 18:03:44 +01:00
Nyall Dawson
fe221d54bf Don't return QStrings by reference, since they're implicitly shared
anyway
2015-10-28 09:47:44 +11:00