100 Commits

Author SHA1 Message Date
Nyall Dawson
b1e63a2815 Don't emit layerModified for every atomic change made during a bulk
operation to the vector layer edit buffer

Eg Instead of emitting layerModified for every individual feature
in a call to QgsVectorLayer::addFeatures, we defer the signal
and emit it only once after adding all the features.

This avoids a lot of expensive, unnecessary work which is triggered
by the signal
2022-11-18 11:51:24 +10:00
Julien Cabieces
91e5130080
Merge pull request #50854 from elpaso/raster-maptips-2
Raster maptips
2022-11-14 08:42:22 +01:00
Alessandro Pasotti
f040c260bd Raster maptips 2022-11-09 09:48:02 +01:00
Alessandro Pasotti
9c2923aa1d Optionally load all stored styles from DB with correct names.
Fixes #37434

Funded by: Ministère des Forêts, de la Faune et des Parcs - Québec
2022-11-07 10:16:04 +01:00
Loïc Bartoletti
e3bf816f55 rename addMultiRing to addRingV2 2022-10-18 12:28:22 +02:00
Loïc Bartoletti
6a1222f187 apply nyall's review: use unique_ptr and sip things 2022-10-18 10:31:02 +02:00
Loïc Bartoletti
5d7a025304 qgsvectorlayereditutils.h: add \since tag 2022-10-18 10:31:02 +02:00
Loïc Bartoletti
992e2bf1df Remove addMultiRing method in QgsVectorLayer.
QgsMapToolAddRing can use the one from QgsVectorLayerEditUtils.
All checks are made inside QgsVectorLayerEditUtils.
2022-10-18 10:31:02 +02:00
Loïc Bartoletti
b09c2d1132 QgsVectorLayer: add addMultiRing and use it in QgsMapToolAddRing
The `QgsMapToolAddRing` adds a ring through the `addRing` method of
`QgsVectorLayerEditUtils` called by this of `QgsVectorLayer`.

The bug described in #23113 indicates that only one of the entities receives the
ring addition when using the map tool.

This is consistent with the documentation of the `addRing` methods.
So, it is by design that the tool works like this.

However, as stated in the ticket, it is best to add the ring to all entities.

In order to avoid an api break, I added a new addMultiRing method that adds the ring on all entities.

Fixes #23113
2022-10-18 10:31:01 +02:00
rldhont
c26d58ece8 feat: New force read only option for vector layer
To be able to open vector layer in a read-only mode, a new vector layer option has been defined to do it.

This option is used to open world_map.gpkg and fixes #35383
2022-09-12 09:17:02 +10:00
rldhont
0fc64b101a feat: Open layers in a read only mode with Qgis::ProjectReadFlag::ForceLayerReadOnly
In most cases of use of QGIS Server, it is not necessary to access the layers in write mode.
The read-only mode is sufficient.

We would like to introduce a new flag Qgis::ProjectReadFlag::ForceLayerReadOnly to
open layers in a read-only mode.
2022-09-12 09:17:02 +10:00
Damiano Lombardi
67bdadfead
Fix rollback not leaving a consistent state for buffered transaction 2022-08-23 10:04:17 +10:00
Jacky Volpes
c31364f15a Enable category selection when saving style to database 2022-05-24 13:07:16 +10:00
Even Rouault
d81b66d611 QgsVectorLayer(): make it clear that WFS URI parameter keys ar case sensitive (refs #46485) 2022-05-24 08:30:40 +10:00
Alessandro Pasotti
4a4e9f27d9 Pass context by const ref 2022-05-18 16:56:40 +02:00
Julien Cabieces
a57281c836 Vectorization of selective masking 2022-05-12 11:45:39 +10:00
Julien Cabieces
d937a59067 Fixes fully-qualified-moc-types 2022-05-10 08:27:47 +10:00
Nyall Dawson
e163361da9 Add option to show markers over continuous surface plot 2022-05-03 12:15:02 +10:00
Nyall Dawson
826cbe37d6 [feature] Add an "interpretation" option for vector elevation profiles
Choices are "individual features" (the default behavior) or "continuous
surface". The new Continuous Surface option is designed for vector
layers which represent a continuous elevation surface, e.g contour
lines or surveyed elevation points. When selected, the elevation
chart will be rendered as a surface instead of separate features
by joining the sampled elevation results into a continuous line.

There's also the same option exposed as for raster and mesh layers
where the appearance can be toggled from a single line to a "fill
below" symbol.

Fixes #48341
2022-05-03 12:15:02 +10:00
Nyall Dawson
9a99ed8800 Don't show vector layers with no interesting elevation properties
set by default in newly created elevation profiles

Fixes #48286
2022-04-22 13:07:16 +10:00
Nyall Dawson
1fc20cb026 Show elevation specific tooltips 2022-04-22 13:07:16 +10:00
Nyall Dawson
71c1c24d56 A vector layer with z values present should default to "relative"
clamping mode, not "clamped to terrain"
2022-04-22 11:40:29 +10:00
Nyall Dawson
ad80958798 Make vector layer profile chart results default to respecting layer
symbology, and add checkbox to disable this in their elevation
properties page

This means that vector results in elevation profile charts will default
to showing features using their corresponding 2d renderer, allowing
eg categorized classes to be visible on the profile chart. (In the
case that a profile symbol type doesn't match the layer's renderer
symbol types, we just take the symbol color from the renderer)
2022-04-12 02:17:02 -07:00
Nyall Dawson
8ee20464a0 Ensure that elevation properties are copied whenever a layer is cloned 2022-04-07 19:22:19 +10:00
Nyall Dawson
3d0fd967af Add profile chart symbology settings for vector layers 2022-04-07 19:22:19 +10:00
Nyall Dawson
87c3c911c0 Implement profile generation for point vector layers 2022-03-25 10:08:11 +10:00
Nyall Dawson
1b95c0ee21 Add an optional QgsExpressionContext argument to QgsVectorLayer::selectByExpression 2022-03-22 11:18:54 +10:00
Damiano Lombardi
03f4740e65 More detailed error feedback for rollback 2022-03-04 08:41:10 +01:00
Damiano Lombardi
22de7e8a69 Fix docstrings since QGIS 3.24 to 3.26 2022-03-04 08:41:10 +01:00
Damiano Lombardi
6b4bba8224 Buffered transactions startEdit/commit/rollback from layer 2022-03-04 08:41:10 +01:00
Damiano Lombardi
cabf50d831 Buffered transactions rollback 2022-03-04 08:41:10 +01:00
Damiano Lombardi
ba1002d163 Show commit errors + docstrings 2022-03-04 08:41:09 +01:00
Damiano Lombardi
219d450075 Initial implementation of buffered transactions 2022-03-04 08:41:09 +01:00
Nyall Dawson
ddf5cd57cc Allow extrusion to be disabled 2022-03-03 06:15:10 +10:00
Nyall Dawson
36dd3745f8 Add documentation note about binding vs point layers 2022-03-03 06:15:10 +10:00
Nyall Dawson
cc24106d01 Add QgsMapLayerElevationProperties subclass for vector layers
Allows elevation properties to be set for vector layers, including:

- altitude binding
- altitude clamping
- extrusion
- scale
- offset

These properties can be set through the new "Elevation" tab in
the vector layer properties dialog
2022-03-03 06:15:10 +10:00
Julien Cabieces
2d2cd13c58
Merge pull request #47392 from signedav/fix_relref_nomodal
Avoid modal dialogs in relation reference /  relation editor
2022-02-21 09:10:49 +01:00
Nyall Dawson
a7b6b41fad Add docs 2022-02-20 06:48:03 +10:00
Nyall Dawson
8cd9b80149 Add browser properties widget for showing the properties of an existing
field domain
2022-02-20 06:48:03 +10:00
Nyall Dawson
3d9a74176e More repr 2022-02-20 06:48:03 +10:00
Nyall Dawson
2be52d9df9 Create QgsFieldDomain and subclasses which directly represent
the GDAL field domain coded value/range/glob domains
2022-02-20 06:48:03 +10:00
signedav
7dac040b47 reenter lost override keyword and some docs 2022-02-16 12:05:47 +01:00
signedav
f971a47b67 Do dialogs not open modal since otherwise the canvas are blocked and we are not able to collect geometries.
Pass widget as parent to the dialog to avoid "orphaned" child dialogs. The widget is passed as parent to QgsFeatureAction. When creating a dialog the widget is passed as parent to the dialog and the dialog is set as parent to the QgsFeatureAction (last like before).
To avoid confusion with opened dialogs the parent's visibility is set to hidden, when child dialog is opened.

This fixes #47193
2022-02-16 09:24:11 +01:00
Nyall Dawson
6bd1a7eb7d Document new behaviour 2022-01-24 17:26:05 +10:00
Matthias Kuhn
fab5d8a84e
Merge pull request #46493 from suricactus/fix_misleading_docs
Fix misleading docs that is only valid if edit buffer is used (so does not work in transaction mode)
2021-12-15 11:49:02 +01:00
Ivan Ivanov
527359bc7c Fix misleading docs that is only valid if edit buffer is used (so does not work in transaction mode)
Long story short, the `layer.committedFeaturesAdded` signal is not fired after `layer.commitChanges()` when in transaction mode.

If the layer is using the `QgsVectorLayerEditBuffer` the `commitedFeaturesAdded` signal is fired.
But if transaction is used and the `layer.editBuffer()` returns `QgsVectorLayerEditPasstrough`, then there is no signal.

The `QgsVectorLayerEditPasstrough` class is quite empty and lacking implementation of these events, so they don't work on layers in a transaction group.
2021-12-14 22:19:34 +02:00
Alessandro Pasotti
630f3f69f6 Return a NULL variant in case of multi/not allow NULL
Because an invalid variant would have not been set
in the feature form.
2021-12-13 13:55:11 +01:00
Alessandro Pasotti
d93bab9dac Use widget value when validating attrs in form
Also, make sure that non enforced constraints
do not block commits and do not report as violated
constraints (Fix #46364).

Followup #46439 because the constraints were
not checked agains the widget value but against
the attribute value.
2021-12-13 10:48:37 +01:00
Nyall Dawson
dcf0cfe5a3 Fix API issues causing malformed python stub files
Fixes #46240
2021-11-29 11:54:06 +10:00
Alessandro Pasotti
d4876f3842 Add operator for flgs and update docs 2021-11-05 07:29:18 +11:00