39 Commits

Author SHA1 Message Date
Nyall Dawson
bf6af35382 Copy error message from aggregate calculator to expression when
aggregate function fails, so that we give more helpful error messages
for debugging aggregate based expressions
2021-08-09 13:00:33 +10:00
Nyall Dawson
f69ff2706a Implement distance within search for vector layer iterator 2021-08-05 14:24:07 +10:00
Nyall Dawson
01e3e1dddc [api] Move QgsGeometry enums to Qgis, promote to enum classes 2021-08-04 09:54:32 +10:00
Nyall Dawson
4bb7f82f2e [sipify] Add check that doxygen //!< command is only used for enum
documentation

sipify can't handle it in other contexts
2021-07-19 16:05:53 +10:00
Nyall Dawson
2724315a99 Move enums from QgsVectorLayer to Qgis, promote to enum classes,
and fix redundant QgsVectorLayer.VertexMarkerType enum
2021-07-19 14:02:39 +10:00
nirvn
2006c975f4 Migrate remaining uses of QRegExp in src/core 2021-07-16 11:01:42 +10:00
Germán Carrillo
92231d74c8 Complete addTopologicalPoints result values for QgsVectorLayer; add tests for error result codes (-1 and 1) 2021-07-05 21:22:16 -05:00
Vincent Cloarec
db21851bbb
[mesh] mesh frame editing part-2 - start, commit, roll back and cancel (#43982)
[mesh] allows the user of mesh layers to start editing, save, roll back or cancel editing, in the same way as vector layers (editing part-2)
2021-07-01 08:18:18 +02:00
Nyall Dawson
11e88f7e92 Responsive cancelation of aggregate expression functions 2021-06-19 06:21:51 +10:00
Nyall Dawson
b16465bc31 Support early abortion of vector layer feature counter
Refs https://github.com/qgis/QGIS/issues/43572
2021-06-19 06:21:51 +10:00
Even Rouault
92fc43505d Update featureCount() methods to return long long for Win64 compatibility 2021-06-15 12:40:04 +10:00
Nyall Dawson
544708f4aa [temporal] Fix filter generation for vector temporal layers
When features have a temporal "range", we should never treat
that range as inclusive of the end (or we end up with features
appearing in multiple date ranges)

Completes fixes begun by @rduivenvoorde in https://github.com/qgis/QGIS/pull/40989

Fixes #38468
2021-06-10 09:56:25 +10:00
Nyall Dawson
5bac4c2c70 [api] Add method to retrieve feature ids of all new and changed
features directly from QgsVectorLayerEditBuffer
2021-06-08 21:27:21 +10:00
Nyall Dawson
5fdb88bae3 Fix massive performance regression in attribute table
Follow up 56f7812ca1e

This commit fixed the ordering of features coming from the
vector layer cache for the attribute table, but came with a massive
speed impact due to the repeated calls QList::contains for
every feature fetched. For any moderately sized table or above
these calls stacked up into multiple minute delays in opening
the table.

Avoid this by tracking the added feature ids in a separate
unordered set, so that we don't need to check through the
ordered list for existing features at all.

Eg a 500k feature gpkg was taking 10 minutes to open the table.
With this optimization that's back down to 20 seconds.
2021-06-08 21:16:33 +10:00
Nyall Dawson
c57d7ad6aa Completely remove QgsVectorLayerFeatureIterator::FetchJoinInfo::joinLayer and note in api_break.dox
There's no point in keeping such a dangerous member in the api
2021-06-03 14:26:23 +10:00
Nyall Dawson
cebb1f8ef9 Fix sip 2021-06-03 14:26:23 +10:00
Nyall Dawson
ca00377027 Do not access join layer from QgsVectorLayerFeatureIterator
This is not thread safe at all - we cannot access a layer from
an iterator, as iterators may be running on background threads.

Instead use a thread safe approach of storing a QgsVectorLayerFeatureSource
and using that instead

Fixes #38551
2021-06-03 14:26:23 +10:00
Denis Rouzaud
35c557a234 run sipify 2021-05-26 14:30:54 +02:00
Nyall Dawson
de406693c7 Move QgsVectorLayerExporter.ExportError to Qgis and promote to enum
class

This avoids an ugly include of qgsvectorlayerexporter.h in
qgsproviderregistry.h/qgsprovidermetadata.h, which in turn
triggers an inclusion of qgsvectorlayer.h and a bunch of
other heavy dependencies.
2021-05-20 21:09:56 +10:00
Nyall Dawson
239092e0f1 Move QgsVectorDataProvider::FeatureCountState enum to qgscoreenums.h 2021-05-18 16:59:22 +10:00
rldhont
b60f5a4548 Revert "Revert "[API] Remove specific deprecated QgsVectorLayer::setDataSource""
This reverts commit 2524f9635a3d09c57ccebb78208cc7b3bf8fb9b6.
2021-04-29 16:37:16 +02:00
rldhont
2524f9635a Revert "[API] Remove specific deprecated QgsVectorLayer::setDataSource"
This reverts commit 88c0d3f07db541b1cb6d5cc81f4aabc12741de26.
2021-04-28 15:00:16 +02:00
rldhont
4afa66af30 [API] Unvirtualize layer setDataSource method
Changes in the layer API:
* The setDatasource() methods become non-virtual public method
* The virtual private setDataSourcePrivate() method is defined and the provider setDataSource implementations have been moved to this new virtual method
2021-04-26 17:14:07 +02:00
rldhont
88c0d3f07d [API] Remove specific deprecated QgsVectorLayer::setDataSource 2021-04-21 14:29:06 +02:00
Nyall Dawson
ffa99b7b64 Fix doxygen blocks which don't use the * prefix on all lines, which
prevents the auto format and sipify scripts from doing their full
formatting magic
2021-04-19 12:54:13 +10:00
Matthias Kuhn
a75f6ab903 [qt6] QVector and QList are unified 2021-03-28 06:26:33 +10:00
Nyall Dawson
40ed79393e Instead of double-iterating over features caused by calling
QgsVectorLayer::minimumValue and then QgsVectorLayer::maximumValue
when we need BOTH the min and max value for a field, add an
optimised QgsVectorLayer::minimumAndMaximumValue() method
which can calculate both min and max at the same time in
a single iteration.

Potentially halves the cost of calculating these values whenever
we are forced to do a full iteration to calculate them.
2021-03-27 12:09:09 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
d8aba0c65a Add FeatureSymbology capability to QgsVectorDataProvider
If present, the provider is able to retrieve embedded symbology
associated with individual features.
2021-03-06 16:37:46 +10:00
Nyall Dawson
c6370c7f52
Speed up QGIS compilation by removing all Qt Module-wide includes
Refs https://www.kdab.com/beware-of-qt-module-wide-includes/
2021-03-05 11:23:15 +10:00
tschmetzer
28c289d8ab
Improve QgsVectorLayer description (#41796)
Improve QgsVectorLayer description providing some more background explanation
2021-02-26 06:44:36 +10:00
Alessandro Pasotti
e89c163118 Complete test coverage for edit buffer
Fix tests
2021-02-13 11:54:16 +01:00
Alessandro Pasotti
8cb15c3260 Editing buffer passthrough 2021-02-12 19:00:57 +01:00
Nyall Dawson
c6613593c7 Don't loop through all selected features multiple times (once per
field) when the attribute form is opened.

This is incredibly expensive, yet only required in a very very small
corner case (field is from a joined layer without the upsert on edit
capabilities).

Refine logic to avoid the scan wherever we can.

Fixes #41366
Fixes #36863
2021-02-09 10:24:45 +10:00
Nyall Dawson
cd2df66674 Use unique_ptr 2021-02-08 13:23:37 +10:00
Nyall Dawson
d0882d0f06 When auto selecting the default identifier field for a layer,
prefer something like "admin_name" over "type_name".

By penalising results with "type", "class", "cat" in their names
we are less likely to accidentally select a category field as the
friendly identifier when a better one exists.

Also add tests for this logic.
2021-02-06 10:10:51 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Denis Rouzaud
2cc632ee5d follow up QVariant 2021-01-03 20:16:56 +01:00
Nyall Dawson
a9c80e5740 Code shuffle
Move vector, project and network related core .cpp/.h files into
dedicated subdirectories.

An attempt to organise src/core better to make things easier to find.
2020-12-29 11:38:11 +10:00