349 Commits

Author SHA1 Message Date
Blottiere Paul
821aadc400 Hide auxiliary columns which can be edited by "change label properties" map tool 2017-10-09 05:13:59 +01:00
Blottiere Paul
5b278d746e Move/rotate/hide/pin map tools are always available 2017-10-09 05:13:59 +01:00
Blottiere Paul
4920a14aab Move isAuxiliaryField to QgsVectorLayer 2017-10-09 05:01:35 +01:00
Blottiere Paul
88e8eb4fd7 Update sip binding 2017-10-09 05:01:35 +01:00
Blottiere Paul
4a8fce2b00 Implement delete field action 2017-10-09 05:01:34 +01:00
Blottiere Paul
a550a32719 Auxiliary layers may be created or loaded from auxiliary storage 2017-10-09 05:01:34 +01:00
Nyall Dawson
42676dc93c Move some getters which are incorrectly marked as slots,
remove some unnecessary 'const's from signals

Thanks to clazy const-signal-or-slot check
2017-10-09 11:53:06 +10:00
Martin Dobias
68bb68d176 [FEATURE] QGIS 3D (pull request #5203) 2017-10-02 23:02:37 +02:00
Matthias Kuhn
2fbb6f09cc
Avoid recursion in apply on update default values 2017-09-29 17:52:34 +02:00
Matthias Kuhn
89289598fe
Doxygen 2017-09-29 17:52:33 +02:00
Matthias Kuhn
17fe7e8aec
Doxygen updates for changed method names 2017-09-29 17:52:32 +02:00
Matthias Kuhn
f2d512a73a
Apply default values on update 2017-09-29 17:52:30 +02:00
Matthias Kuhn
7b36287ff3
Use QgsDefaultValue throughout the code 2017-09-29 17:52:29 +02:00
Matthias Kuhn
cab3a38461
Doxymentation 2017-09-29 17:52:29 +02:00
Nyall Dawson
01d34ede9d Sip sync 2017-09-25 17:12:03 +10:00
rldhont
f88af6d55f QgsVectorLayer, countSymbolFeatures return QgsVectorLayerFeatureCounter 2017-09-19 07:34:35 +02:00
Matthias Kuhn
63def3d870
Doxygen improvements 2017-09-18 18:32:06 +02:00
Vincent Mora
f63c302420 [FEATURE] Add undo and redo on transaction groups (#4765)
* [FEATURE] adds undo/redo for transaction groups

[needs-docs] the undo/redo now works with transcation groups. Just check
that there is no restriction in the transaction groups doc concerning
undo.

related to #14799

The undo/redo is implemented using SAVEPOINT.

The QgsTransaction interface has been enlarged to allow savepoints
creation and management. The savepoint is destroyed on
rollbackToSavepoint to have the same behavior has the sql ROLLBACK TO
SAVEPPOINT.

To avoid the creation of a savepoint for each feature modified in bulk
editing (e.g. paste, field calculator) the logic is a bit complicated: the
savepoint is created on QgsVectorLayer::editCommandStarted and the first
actual undo command (QgsVectorLayerUndoPassthroughCommand) is
responsible for the re-creation of the savepoint in case of undo-redo.
Since the behavior must be different in case edition doesn't take place
inside an edit command, a member function has been added to
QgsVectorLayer to expose the mEditCommandActive state.

Another (commented) tricky bit is the modification of the database
structure on add/delete attributes. On undo, the attribute is removed
before the rollback to savepoint, i.e. there is a useless ALTER TABLE
issued to restore the structure just before restoring it with the
ROLLBACK TO SAVEPOINT. This is necessary to make the provider
aware of the change of structure. It could be nicer/cleaner to have a way
to reload providers metadata.

The editPaste function has also been modified to use addFeatures instead of
addFeature (plural/singular), this is at the expense of an additional "cpy"
of the clipboard in memory, but it should improve perf with postgis provider.

* fixup operator aliases
2017-09-15 14:55:43 +02:00
Martin Dobias
6df6681326 Read/write 3D renderers of map layers to project files 2017-09-15 10:39:07 +02:00
Nyall Dawson
f799d3afc8 Move allFeatureIds from QgsVectorLayer to QgsFeatureSource 2017-09-08 20:09:29 +10:00
Blottiere Paul
7ef2e7046e Some cleanup and renaming 2017-09-06 14:46:37 +01:00
Blottiere Paul
eb725f3305 Do not update extent by default if trust project option is activated 2017-09-06 14:46:37 +01:00
Blottiere Paul
384e85ca77 Add option on layer to read extent from xml in case of data source without metadata 2017-09-06 14:46:37 +01:00
Matthias Kuhn
4ea4478bad Thread safety for feature counter
Make sure that results from a feature counter will only be delivered on
the main thread and that they will be discarded if the layer is deleted
meanwhile.
2017-09-05 12:18:52 +02:00
Blottiere Paul
477775a5d7 [FEATURE] Joined fields are editable if the option is activated 2017-08-28 14:09:55 +01:00
Nyall Dawson
eb0c3015f9 Push minimumValues/maximumValues up to QgsFeatureSource base class
Allows these methods to be called on feature sources
2017-07-13 20:07:33 +10:00
Harrissou Sant-anna
9e6b8ed59d Use PostGIS and PostgreSQL spelling when appropriate 2017-07-07 01:26:38 +02:00
Harrissou Sant-anna
6fab688298 Use SpatiaLite right spelling when needed 2017-07-07 01:26:38 +02:00
Denis Rouzaud
5b8e2c2f27 remove QgsVectorLayer::hasGeometryType in favor of QgsMapLayer::isSpatial 2017-07-05 10:18:32 +02:00
Nyall Dawson
7ae1ee975d Add sourceName() method to QgsFeatureSource
Sometimes it's necessary to retrieve the name of a source...
2017-06-26 12:15:01 +10:00
Nyall Dawson
fc339f9ac5 Add a flag argument to QgsFeatureSink::addFeatures
Flags can be used to control how features are added to the sink.

For now, there's only a single flag available - FastInsert.
When FastInsert is set, faster inserts will be use at the cost
of updating the passed features to reflect changes made at the
provider.

This includes skipping the update of the passed feature IDs
to match the resulting feature IDs for the feature within
the data provider.

Individual sink subclasses may or may not choose to respect
this flag, depending on whether or not skipping this update
represents a significant speed boost for the operation.

QgsVectorLayer always ignores the flag - feature ids are
required for the featureAdded signal to be correctly emitted,
and it's expected that performance critical applications will
add features directly to a data provider instead of
via QgsVectorLayer's edit buffer.
2017-06-15 17:04:27 +10:00
Nyall Dawson
de9e70e6ba Merge pull request #4684 from nyalldawson/processing_pt3
Add sourceExtent method to QgsFeatureSource
2017-06-06 21:50:45 +10:00
Martin Dobias
51e7efe218 Replace QString::null by QString() in core (deprecated since Qt 5.9) 2017-06-06 11:36:41 +02:00
Nyall Dawson
c6c20c6114 Add sourceExtent method to QgsFeatureSource 2017-06-06 17:26:07 +10:00
Nyall Dawson
3388857526 Move uniqueValues to QgsFeatureSource
Also change signature of QgsVectorLayer/QgsVectorDataProvider
uniqueValues method to match (and improve API)
2017-06-05 16:59:08 +10:00
Matthias Kuhn
a9d7630a69 Rename QgsPointV2 to QgsPoint and QgsPoint to QgsPointXY
Because 3D coordinates should be the default.

References https://github.com/qgis/qgis3.0_api/issues/36
2017-06-02 19:53:37 +02:00
Nyall Dawson
bcf4026f9d Flip QgsVectorLayer from transparency to opacity 2017-05-30 08:48:55 +10:00
Nyall Dawson
4647662664 Add crs, fields, wkbType and featureCount to QgsFeatureSource 2017-05-25 12:31:06 +10:00
Nyall Dawson
8bfeb8f73b QgsVectorLayer, QgsVectorDataProvider are QgsFeatureSources 2017-05-25 12:31:06 +10:00
Blottiere Paul
bb1738dcbb Update documentation and sip binding 2017-05-18 11:09:42 +02:00
Blottiere Paul
f92a38cf54 Clone more members in vector layer 2017-05-18 11:09:42 +02:00
Blottiere Paul
8a6137247a Remove the deep copy functionality 2017-05-18 11:09:41 +02:00
Blottiere Paul
42a967904a Update sip binding 2017-05-18 11:09:23 +02: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
Martin Dobias
24e06a4941 Remove unused mAnnotationForm member + getter/setter from QgsVectorLayer 2017-05-14 17:41:14 +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
Martin Dobias
8ffd91ea90 Propagate path resolver through renderers, annotations, diagrams
This is necessary in order to be able to correctly translate between absolute and relative paths
deeper in the code - e.g. paths to SVG files used in marker or fill symbols.

Until now, relative paths were translated to absolute paths on the fly.
This is now changed - paths to files should be always absolute within QGIS objects - and paths
only get turned into relative when saving projects. When loading a project, relative paths
are translated to absolute paths immediately.

This should lower the overall confusion about relative/absolute paths within QGIS, and also
allow having different base directories for relative paths (e.g. QML or QPT files may use relative paths
to their directory - rather than to the project directory)
2017-05-13 18:02:19 +08:00
Alessandro Pasotti
074c41a157 Tiny typo fix - SIP part 2017-05-11 18:28:01 +02:00
Matthias Kuhn
ed747edc94 Improve docs and python bindings for feature count 2017-05-11 12:42:26 +02:00
Matthias Kuhn
964d9ac70a Send feature counting to background task 2017-05-11 12:42:26 +02:00