77 Commits

Author SHA1 Message Date
Matthias Kuhn
42af1efa18 Fix a bunch of doc issues 2020-10-22 20:42:14 +02:00
Nyall Dawson
9f97955900 Further improvements to QgsProject dox 2020-10-21 09:32:15 +10:00
Julien Cabieces
a259f509ad
ReadEntry ok value must be set to False when property doesn't exist
Fixes #37851 : readEntry ok value must be set to False when property doesn't exist
2020-10-21 06:12:14 +10:00
Alessandro Pasotti
e79103e354 Spelling 2020-09-17 07:28:45 +10:00
Alessandro Pasotti
cbb0cb3f1c Add a warning about the usage of setInstance 2020-09-17 07:28:45 +10:00
Alessandro Pasotti
a782420153 Update SIP 2020-09-17 07:28:45 +10:00
Alessandro Pasotti
c80093c47a Expose QgsProject::setInstance to API
Fixes #38755

Needs forward porting to all active branches
2020-09-17 07:28:45 +10:00
Nyall Dawson
39fbc2ac33 Add "mainAnnotationLayer" to QgsProject
This returns a reference to a main/default annotation layer for use
by the project. It forms the default location to place new annotation
items which should appear above all map layers.
2020-09-01 15:29:32 +10:00
rldhont
3c7d6616d1 New Project Reading flag to trust layer metadata 2020-08-11 18:14:15 +02:00
Nyall Dawson
4dc9b38142 Add API to retrieve QGIS version used to save a QgsProject
project.lastSaveVersion()

now returns the version number used to save the project.
Also cleanup QgsProjectVersion code

Fixes #37288
2020-06-20 04:21:53 +10:00
Denis Rouzaud
044a05d828 run sipify 2020-06-19 08:47:23 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
Nyall Dawson
d74715c310 Add metadata to project for last save datetime alongside the existing
last saved username details
2020-06-05 08:41:00 +10:00
Nyall Dawson
1d995840ec Add API to set an "original path" for QgsProject
This is intended for use with non-qgs/qgz project files
(see QgsCustomProjectOpenHandler) in order to allow custom project open handlers
to specify the original file name of the project. For custom project formats,
it is NOT appropriate to call setFileName() with the original project path, as
this causes the original (non QGIS) project file to be overwritten when the
project is next saved.
2020-06-05 08:41:00 +10:00
David Signer
550ee2c0e0 dataDefinedServerProperties for the overrides of user defined server variables (currently only WMSOnlineResource) as QgsPropertyCollection alongside the ProjectProperties 2020-05-15 07:09:52 +02:00
David Signer
7c0d3b5829 const of QgsProperty and some styling 2020-05-14 09:48:41 +02:00
David Signer
0e4b6b8cad WMSOnlineResource can be defined by an expression. This means it's stored as a QgsProperty.
Functions to read and write QgsProperty.
2020-05-13 19:39:31 +02:00
Mathieu Pellerin
c0a29051b4 [FEATURE][digitizing] Add avoid intersection/overlap mode
This commit adds a new avoid intersection mode setting when
digitizing new features. The three available modes are:
- allow intersections/overlaps
- avoid intersections/overlaps on active layer
- avoid intersectonss/overlaps on layers list

The third mode is what QGIS has had for a while, except
its UI/UX is a bit messy. The layers list is setup by
the user via the advanced snapping configuration widgets,
but isn't connected at all with whether snapping is
enabled / disabled.

This new approach makes it explicit to user whether
newly-added features might be clipped or not, and
if so by which layer(s).

Finally, the new 'avoid intersections/overlaps on
active layer' is likely a far more useful behavior
than having a list of layers (for e.g., you might
be digitizing on a layer that can't have overlap
with itself but is fine to overlap with another
layer, the latter also in need of avoid overlap
_with itself_).
2020-04-10 13:42:07 +07:00
Nyall Dawson
f7e5347a3a Dox, header cleanups 2020-03-12 20:06:25 +10:00
Samweli Mwakisambwe
0facf5450d
QGIS Project temporal settings
Adds the ability to set a temporal range for a project
2020-03-07 07:43:13 +10:00
Nyall Dawson
d2639bc662
Fix mention of compositions in dox (#34318) 2020-02-06 06:19:30 +01:00
Nyall Dawson
4f41ba2fcb Fix see also link 2020-01-21 11:28:15 +10:00
Nyall Dawson
cfba5cff00 User standard capitalization 2020-01-21 11:28:15 +10:00
Nyall Dawson
8f1a5f7075 Add since version 2020-01-21 11:28:15 +10:00
Nyall Dawson
ea7cdbdf91 Sipify 2020-01-21 11:28:15 +10:00
Denis Rouzaud
18a7cd0659
[FEATURE] Add an option to set the default project file format (qgs/qgz) (#33872) 2020-01-17 12:12:02 +01:00
Nyall Dawson
410da5e358 New class QgsProjectDisplaySettings
This class (attached to a QgsProject object) provides a place to
store and retrieve settings related to project display behavior,
e.g. the numeric formats used for bearings and coordinates
2020-01-09 17:10:30 +13:00
Nyall Dawson
65490ab13e Move QgsProject map scales settings to a new class, QgsProjectViewSettings
attached to QgsProject

And deprecate old getters/setters

The goal here is to create a place for project view related settings (e.g.
map scales, default extent, possibly future things like a fixed project
maximum area of interest, etc). Currently these are all handled in an
ad-hoc way, e.g. sometimes in project custom keys, sometimes inside
xml saved and restored by map canvases. But both these approaches break
important use case for plugins, e.g. creating a project from scratch
which will zoom to a desired extent on load. That's totally impossible
in the current API, unless you resort to extremely fragile manual
xml crafting...
2019-10-31 14:59:39 +10:00
Denis Rouzaud
758d7cff4a run sipify to update deprecation annotations 2019-10-15 13:17:38 +02:00
nirvn
23cc659a05 [projects] Add signals for background color and selection color change 2019-10-07 15:47:30 +07:00
nirvn
6bc83965a8 [projects] Serve selection color through a proper API 2019-10-07 15:47:30 +07:00
nirvn
5863f63ae1 [projects] Serve default canvas background color through a proper API 2019-10-07 15:47:30 +07:00
Nyall Dawson
d0ed374662 Add QgsProject flag to avoid loading print layouts when reading a project file
Speeds up project read time when these aren't needed, and also potentially
avoids issues caused by non-thread-safety in layouts (since some items rely
on classes which can only be used in the main thread e.g. QWebPage)
2019-10-04 05:10:45 +10:00
Nyall Dawson
387272d441 QgsProject documentation improvements 2019-10-03 20:12:28 +10:00
Nyall Dawson
e7e41e1cb9 Add stable api for setting/retrieving project custom scales
Previously this was all done through raw project key manipulation,
but there's a use case for exposing this nicely for use by plugins.
2019-10-03 14:15:19 +10:00
Nyall Dawson
d94329a788 Make QgsProject responsible for project expression context creation,
and cache the project expression context as much as possible

This scope can be expensive to create upfront, but is cheap to copy
2019-09-07 15:56:40 +10:00
Nyall Dawson
d8300987e8 [FEATURE][API] New class QgsBookmarkManager
Attached to QgsProject, this provides a stable, supported method
of managing project bookmarks (vs the old undocumented, not stable
approach of directly manipulating project keys)
2019-09-04 14:19:47 +10:00
Nyall Dawson
65a3f81486 Add some missing Python repr overloads 2019-09-02 16:40:46 +10:00
Alessandro Pasotti
92ac7a2e93
[server] Server api and WFS3 (#10016)
Implementation of OGC API and WFS3 core draft specification
2019-08-06 16:38:21 +02:00
Matthias Kuhn
ce8004446a Update the project ellipsoid if CRS is taken from first layer
Fix #30815
2019-07-19 11:08:39 +02:00
Nyall Dawson
0cdad2307b Add api to allow reading a QgsProject file without loading any layers
This causes the project to be read, but no data providers created for
layers (i.e. the same result as loading a project in the app and
choosing to leave bad layers in the project).

It's intended for occasions when you want to efficiently access properties
of a project without the (often very expensive) cost of actually
loading layers. E.g. to just read project metadata, parse the
layer tree structure, extract print layouts or renderer properties, etc.
2019-07-10 08:10:49 +10:00
Nyall Dawson
590d1aae9d [FEATURE][API] Visitor API for style entities
Adds a new visitor pattern API for creation of visitors which visit
all the style entities (symbols, color ramps, text formats, and
label styles) associated with different objects. Can be used on a
renderer, map layer, or project wide level.

E.g. on a project wide level, allows collection of ALL the style
symbols/color ramps/text settings inside a project, including those
in layouts or annotations!
2019-07-06 12:36:54 +10:00
Alessandro Pasotti
75defad55c Remove warning 2019-07-05 13:33:27 +02:00
Matthias Kuhn
6eb5b3e770 Add a template list to the welcome screen 2019-05-27 14:57:35 +02:00
Matthias Kuhn
00d31f6003 Revert "Merge pull request #10002 from m-kuhn/qgz-attachments"
This reverts commit 0804e342c863455fe7114e4fa84d8b9931656f8c, reversing
changes made to e07741f00b7d69cada35521f10d3703ff404083f.
2019-05-16 13:15:07 +02:00
Matthias Kuhn
a55c25bbeb Allow adding attachments in qgz files 2019-05-15 08:21:49 +02:00
Nyall Dawson
107b48a430 Add NULLPTR macro for use in doxygen comments
For the c++ api dox this expands to "\c nullptr" (the
\c directive indicates a code literal value), and for sipify/Python
it expands to ``None`` (`` is sphinx annotation for literal values)

Makes for nicer dox for both c++ and Python!
2019-02-27 09:41:11 +10:00
Nyall Dawson
a7ca08784c Nullptr consistency in dox 2019-02-27 09:41:11 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
Matthias Kuhn
2fb37042a5
Fix TODO and docstrings 2019-02-07 14:36:43 +01:00