1651 Commits

Author SHA1 Message Date
Martin Dobias
f153e19168 Fix saving of "obstacle only" state + misc fixes to unit tests 2017-05-16 14:25:32 +08:00
Martin Dobias
828bd384c5 Convert remaining bits where labeling was configured using setCustomProperty() 2017-05-16 14:25:32 +08:00
Martin Dobias
21f03bc11c Clean up reading/writing of labeling configuration in vector layers
Historically the configuration used to be stored in layer's custom properties, but that does not scale
beyond simple rendering and so rule-based labeling introduced storage of configuration natively in XML elements.
That left us with two different ways of reading/writing labeling configurations. This work makes all configuration
to use native XML elements.

To keep compatibility of 2.x projects, reading of configuration from custom properties is preserved.

This commit also adds Python APIs for direct manipulation of labeling configuration through vector layer's
setLabeling() and labeling() calls.
2017-05-16 14:25:32 +08:00
Nyall Dawson
ac94345331 Rename QgisGui to QgsGuiUtils
Better reflects what this namespace contains, and replaces the
non-standard Qgis prefix with the Qgs standard
2017-05-15 07:33:52 +10:00
Nyall Dawson
436844b205 QgsMapLayerActionRegistry is no longer a singleton
Moved the global instance to QgsGui::QgsMapLayerActionRegistry()
2017-05-15 07:32:38 +10:00
Nyall Dawson
a86b93e957 QgsLayerTreeEmbeddedWidgetRegistry is no longer a singleton
Moved the global instance to QgsGui::layerTreeEmbeddedWidgetRegistry()
2017-05-15 07:32:01 +10:00
Nyall Dawson
711f6dcc50 QgsShortcutsManager is no longer a singleton
Move the global instance to QgsGui::shortcutsManager()
2017-05-15 07:32:01 +10:00
Nyall Dawson
4a5c9a7ba3 Make a new global QgsGui singleton
Move QgsEditorWidgetRegistry from being a singleton itself to
instead being a member of the QgsGui singleton
2017-05-15 07:32:01 +10:00
Martin Dobias
24e06a4941 Remove unused mAnnotationForm member + getter/setter from QgsVectorLayer 2017-05-14 17:41:14 +08:00
Martin Dobias
0ccaba7a70 Path resolver instead of project singleton in edit form config and svg annotation 2017-05-14 10:34:01 +08:00
Martin Dobias
c882f88c1d Remove "relative path" checkbox from svg selector widget
It is decided on different level whether files are saved with relative paths
and internally now QGIS always uses absolute paths to SVG files.
2017-05-13 19:43:47 +08:00
Martin Dobias
5bdae75156 API break update + read/write context in labeling and text renderer
This enables correct loading/saving of relative paths of SVG files for background of labels
2017-05-13 18:12:04 +08:00
Martin Dobias
23a7bd0fd9 Introduce QgsReadWriteContext that encapsulates QgsPathResolver
This should make the read/write methods more flexible if we need to give them extra context.
2017-05-13 18:09:26 +08:00
Nyall Dawson
b6a5cc4204 Use QgsFeedback instead of QProgressDialog for QgsVectorLayerExporter::exportLayer
And add cancelation and progress reporting to background layer export
2017-05-12 08:03:23 +10:00
Nyall Dawson
75a5d5dda1 Remove unused skipAttributeCreation option in QgsVectorLayerExporter::exportLayer 2017-05-12 08:03:23 +10:00
Nyall Dawson
384369c3c4 Rename QgsVectorLayerImport to QgsVectorLayerExporter
Since the majority of users of this class will be exporting
an existing map layer to a data provider, the QgsVectorLayerImport
name is misleading and suggests that this class is designed
just to bring layers "into" QGIS.

Explicitly naming the class "Exporter" should help API users
discover this class.

Also cleanup API and improve docs
2017-05-12 08:02:51 +10:00
Nyall Dawson
a32314d8b5 Add a new QgsRasterBandComboBox widget
And use wherever custom widgets were being created. Reduces
duplicate code and allows specialised handling for raster
band display/selection to be centralized.
2017-05-09 19:23:08 +10:00
Nyall Dawson
ac7cc12ca7 Merge pull request #4511 from nyalldawson/composer_async
Asyncronously render composer map previews
2017-05-08 20:18:16 +10:00
Nyall Dawson
29c87de679 [needs-docs][composer] Remove Render/Cache modes from composer maps
Make maps invalidate cache whenever layer order changes. Cache mode
is now identical to Render mode, so  all mode switching has been
removed from composer maps. This should greatly simplify the learning
curve and usability of composer maps.
2017-05-08 19:31:55 +10:00
Alessandro Pasotti
de03642ebb Consolidate QgsRequestHandler 2017-05-08 11:14:14 +02:00
Nyall Dawson
5e3b903955 [needs-docs][composer] Remove Rectangle mode from composer maps
No longer required - the Cache mode is now performant enough
that we don't have to rely on the old rectangle preview
when desiring responsive composers
2017-05-08 17:10:07 +10:00
Nyall Dawson
abe8ead1a5 Rework how composer map cache is invalidated
Avoids unnecessary redraws and defers cache update until
when item is actually visible
2017-05-08 17:10:02 +10:00
Alessandro Pasotti
a882a3b5fe Added server changes to API break docs 2017-05-06 09:49:31 +02:00
Nyall Dawson
1033c7b3bd Remove unused argument 2017-05-06 14:59:56 +10:00
Nyall Dawson
8d03642387 Merge pull request #4487 from nyalldawson/memory
Move memory provider to core
2017-05-06 14:13:15 +10:00
Martin Dobias
0a0c33dcf2 Remove QgsGeometryCache class
The geometry cache was only used for few geometry editing operations anyway. In earlier versions
of QGIS the geometry cache was also used by old snapping classes which have been replaced
by QgsPointLocator that also keeps a spatial index of geometries and it is not rebuilt on every re-render.

Reasons for removal:
- geometry cache was repopulated on every redraw of layers in editing mode, slowing down rendering
- data structure for the cache was a simple map with features accessed by their ID (no spatial index)
- the cache was only getting refreshed for the current view of the main map canvas (not a generic cache)
- not used for snapping anymore where caching was important to avoid roundtrips to data provider
2017-05-06 10:34:23 +08:00
Nyall Dawson
ba2fdf00ab Rename some QgsProviderRegistry methods to clarify that they are factories
- provider() was renamed to createProvider()
- selectWidget() was renamed to createSelectionWidget()
- providerLibrary() was renamed to createProviderLibrary()
2017-05-06 12:28:06 +10:00
Nyall Dawson
5511b07e40 Move memory provider to core
This commit introduces basic support for non-library based
data providers, and moves the memory provider from a library
based provider to a core provider.

The memory provider is used so frequently throughout QGIS that
it has become integral to QGIS functionality and must be
available wherever the QGIS core library is used.

The changes here (while not exposed yet to Python) could potentially
be built on to allow creation of pure Python data providers.
2017-05-06 12:05:12 +10:00
Nyall Dawson
998ca4a8ce Preparation for metadata directory 2017-05-04 07:29:56 +10:00
Nyall Dawson
df1ead5ed4 [processing] Remove vector.spatialindex()
Use QgsProcessingUtils.createSpatialIndex() instead.
2017-05-02 13:39:36 +10:00
Nyall Dawson
bde1bf457b [processing] Remove unused vector.duplicateInMemory() function 2017-05-02 13:29:42 +10:00
Nyall Dawson
7eb7a7aa01 [processing] Remove vector.bufferedBoundingBox()
Use QgsRectangle.grow() instead
2017-05-02 13:27:01 +10:00
Nyall Dawson
2b1dda4c78 Update API break docs 2017-05-02 12:34:05 +10:00
Juergen E. Fischer
4ae22ac67e update INSTALL following 82418ea0 2017-04-30 16:58:15 +02:00
Juergen E. Fischer
82418ea04e debian packaging: disable WITH_PYSPATIALITE in favor of libsqlite3-mod-spatialite 2017-04-30 15:56:37 +02:00
Juergen E. Fischer
b29a10eeb7 hub.qgis.org moved to issues.qgis.org 2017-04-29 23:34:27 +02:00
Nyall Dawson
0b0ccc9e9d Rename QgsVectorLayer::selectedFeaturesIterator to getSelectedFeatures
It's more in line with QgsVectorLayer::getFeatures, hence a more
discoverable API
2017-04-27 11:16:10 +10:00
Nyall Dawson
e9f13d1ea3 Just use standard QgsMessageLog functionality instead of a dedicated
method for processing
2017-04-26 13:57:06 +10:00
Nyall Dawson
1394c28d13 [processing] Move some log handling to c++ class 2017-04-26 13:56:29 +10:00
Nyall Dawson
fea6bff707 Merge pull request #4389 from nyalldawson/scalebar
Refactor scalebar renderer, split from composer
2017-04-26 12:40:06 +10:00
Nyall Dawson
b40bc0c1f7 Refactor scale bar rendering
Move all scalebar rendering code out of composer and ensure that
all scalebar rendering is done independant of QgsComposerScaleBar

This allows scalebar rendering code to be reused by plugins
and by non-composer code.

Also rename QgsScaleBarStyle -> QgsScaleBarRenderer, (and all
subclasses too). This name better reflects what these classes do.
2017-04-26 11:46:51 +10:00
Nyall Dawson
c4578c3c1d QgsVectorLayer is a QgsFeatureSink
Also cleanup API for addFeature(s) in QgsVectorLayer, by removing
the unused extra argument from addFeature() and be removing the
makeSelected argument from addFeatures() (code should be adapted
to manually select added features after adding if desired - this
was only used in a single place in the QGIS code and I suspect
this was unintentional in any case)
2017-04-26 11:32:34 +10:00
Denis Rouzaud
448d2fddd3 [doxygen] add include path to allow macro retrieval 2017-04-25 13:28:01 +02:00
Alessandro Pasotti
cbcd193875 [server] Add to API break and pass enum by value 2017-04-22 13:56:00 +02:00
Martin Dobias
25ed76b86e Move labeling engine config to a new class + QgsPalLabeling cleanup
Another bit to make core library independent from QgsProject::instance().
Until now labeling engine configuration was taken from project singleton.

Removed legacy methods from QgsPalLabeling - the class now does not have
any more member variables/methods, it is just a bunch of helper functions.

(PR #4384)
2017-04-21 18:04:09 +08:00
Juergen E. Fischer
5d6ebd4696 update INSTALL 2017-04-20 09:23:27 +02:00
Martin Dobias
24c5b0326f Rewrite addTopologicalPoints() and remove legacy snapping code + unit test 2017-04-19 11:24:20 +08:00
Nyall Dawson
cc5b9bfe17 More QgsDistanceArea API cleanups and simplification
- setEllipsoidalMode() was removed. Ellipsoidal calculations are
now enabled whenever a valid ellipsoid() has been set. Set the
ellipsoid to 'NONE' to disable ellipsoidal calculations.

- ellipsoidalEnabled() was removed. Ellipsoidal calculations
are now enabled whenever a valid ellipsoid() is set. Check
willUseEllipsoid() to determine whether ellipsoidal
calculations will be performed.

- sourceCrs() and setSourceCrs() now always take and return
QgsCoordinateReferenceSystem objects. All string/ID based CRS
methods were removed.

- geographic() was removed. This was only used internally
in one place, so was replaced with sourceCrs().isGeographic() instead.

- some largely overlapping measurement functions were consolidated
2017-04-18 08:14:16 +10:00
Martin Dobias
7b202edf04 Remove QgsVectorLayer::snapPoint() and unused code in QgsSelectedFeature 2017-04-17 17:37:16 +08:00
Martin Dobias
316d9c3359 R.I.P. QgsSnapper and QgsMapCanvasSnapper
These classes have been replaced by more efficient and flexible classes
(see QgsPointLocator, QgsSnappingUtils, QgsMapCanvasSnappingUtils)
2017-04-17 17:08:48 +08:00