19592 Commits

Author SHA1 Message Date
Loïc Bartoletti
da7c8fa04e sipify 2021-06-09 10:45:40 +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
ae83444c9f Expand on QgsPoint/QgsPointXY documentation to clarify when each
class should be used

Fixes #43598
2021-06-08 18:47:01 +10:00
Loïc Bartoletti
17d1443ace is2DClosed -> isClosed2D and fix a typo 2021-06-08 14:26:20 +10:00
Loïc Bartoletti
df02c00f13 sipify 2021-06-08 14:26:20 +10:00
Ivan Ivanov
cd6e0cebe0
Load the default relation editor if the relation editor type setting is not set (#43591)
* Load the default relation editor if the relation editor type setting is missing

* Add setDefaultWidgetType and defaultWidgetType to the relation editor registry

* Use the new defaultWidgetType() when relation editor type setting is missing
2021-06-07 21:46:25 +02:00
Andrea Giudiceandrea
7d57aeef22
Add test for GRASS r.proj alg 2021-06-04 16:52:57 +02:00
Andrea Giudiceandrea
57326cbb20
[processing][grass] Fix r.proj in Windows
Properly escape the equal sign in the for /f command and fix a typo in the variable name
2021-06-03 23:54:37 +02:00
Nyall Dawson
81ec79c0e5 [temporal] Fix broken animations when a non-integer interval value
is used (e.g. 1.5 hours)

The frame number was not being considered, making it impossible
to advance the animation
2021-06-03 15:06:01 +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
Julien Cabieces
a164a2a452 [PyQGIS] Fixes qgis#42488 : Fix QgsFeatureFilterModel SIP interface 2021-06-03 07:57:41 +10:00
AlisterH
c1c068b28b
Add tags for gdal_edit processing algorithm (#43484) 2021-06-03 07:03:23 +10:00
Denis Rouzaud
092527398d
remove read-only line edit in QgsRelationReferenceWidget (#43509)
keep the read-only config and make the drop-down read-only instead

fixes #42813
2021-06-02 17:06:52 +02:00
franc
a5402f74a7 [bugfix][ui][rastercalculator] commit for disabling translation for operators in raster calculator
fixes #42441

changed two files, unchecked the option for translation for the operators button of the calculator
2021-06-02 16:40:46 +02:00
Denis Rouzaud
2029b9b103 add missing enum dox 2021-06-02 12:05:24 +02:00
nicogodet
2e5e6264bf fix auto populating when input param is QgsProcessingParameterMapLayer 2021-06-02 07:14:30 +10:00
Nyall Dawson
c8004cb3c6 [browser] Add global option to disable monitoring of directories
Allows users to manually opt-out of monitoring directories in
the browser by default, and also provides a mechanism for
enterprise installs to disable this potentially unwanted behavior.
2021-06-02 07:13:14 +10:00
Nyall Dawson
22cc4da6e9 Update python/pyplugin_installer/installer_data.py
Co-authored-by: nicogodet <39594821+nicogodet@users.noreply.github.com>
2021-06-02 07:12:51 +10:00
Nyall Dawson
00c7232f1c Fix typehint 2021-06-02 07:12:51 +10:00
Nyall Dawson
154c7f0196 Some minor cleanups to pyplugin_installer.py
- add some type hints
- remove unnecessary comment lines
- replace raw ints with descriptive enum values
2021-06-02 07:12:51 +10:00
Matthias Kuhn
1975368d97
Merge pull request #43478 from nirvn/gsl_split
Allow GSL-less qgis analysis library
2021-06-01 09:49:30 +02:00
nirvn
54e8d80513 Add missing SIP bits 2021-06-01 13:49:56 +07:00
Denis Rouzaud
bb1693b314 add extra enum NoButton to avoid saving an empty string when using qgsFlagsValueToKeys
fixes #43123
2021-06-01 07:33:13 +02:00
Denis Rouzaud
727a9a865c add dox to duplicated enum in QgsAttributeEditorRelation and QgsRelationEditorWidget
also remove leftover
2021-06-01 07:19:17 +02:00
nirvn
0008158ab0 Allow GSL-less qgis analysis library 2021-06-01 11:39:21 +07:00
Denis Rouzaud
e7ccf1fcc6 also do non scoped enums 2021-05-31 09:36:21 +02:00
Denis Rouzaud
d2e899547c sipify all 2021-05-31 09:36:21 +02:00
vcloarec
0c0a1f81c2 pure QgsMapRendererJob::startPrivate() ans SIP_ABSTRACT 2021-05-31 13:09:45 +10:00
vcloarec
d471cc1593 Update src/core/qgsmaptopixel.h
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2021-05-31 13:09:45 +10:00
vcloarec
3d31477750 do not render when map settings are invalid 2021-05-31 13:09:45 +10:00
vcloarec
09b5ba4e2d invalidate map settings when ...
parameters of QgsMapToPixel leads to an invalid transform
2021-05-31 13:09:45 +10:00
Nyall Dawson
8ff0efd230 [browser] By default do not monitor directories on drives we know
are slow

Effectively this means that the browser no longer defaults to watching
network and remote drives (on Windows) for changes. This is expensive
to do and can result in large hangs in the QGIS application.

Users can still manually opt-in to monitoring of these locations
through the context menu of the directory in the browser panel.
2021-05-31 12:23:56 +10:00
Nyall Dawson
af1900f539 [browser] Add api to QgsDirectoryItem to control whether directory
items should be automatically monitored for changes

This monitoring can be expensive for some locations (eg network
folders or cloud based directories), so in these cases it is
desirable to allow it to be disabled to avoid hangs in the QGIS
application.
2021-05-31 12:23:56 +10:00
Nyall Dawson
63c4f4fe7f __repr__ for browser items 2021-05-31 12:23:56 +10:00
Nyall Dawson
02266ef8e6 Rename Qgis::MessageLevel::None to NoLevel. None is a reserved
keyword in Python, so this value was previously inaccessible to PyQGIS
scripts

Also change all references to Qgis::MessageLevel values to their
fully qualified names, to ease a future transition to an enum
class (when sip bugs are fixed)

Fixes #42996
2021-05-30 10:36:01 +10:00
Nyall Dawson
4e73dd92b9 Fix accidental api break
QFlags created from enum classes aren't automatically converted
from an int value passed by Python code, so we need to create
compatibility functions for the older variants which accept
plain ints
2021-05-30 09:27:41 +10:00
Nyall Dawson
61ac64c5a1 [processing] Python entry in history dialog should be processing.run
line, not processing.execAlgorithmDialog

We want this line to be copy/pastable into a script which executes
the algorithm without user interaction, same as QGIS <= 3.18

Followup https://github.com/qgis/QGIS/pull/42541
2021-05-28 14:34:20 +10:00
Nyall Dawson
3d3f3f7f59 Promote more Qgis enums to enum classes, add Q_ENUM 2021-05-28 11:07:25 +10:00
Nyall Dawson
005a0ad093 Sipify 2021-05-27 13:44:15 +10:00
Nyall Dawson
b4fea529f1 Promote Qgis::DataType to enum class 2021-05-27 13:44:15 +10:00
Nyall Dawson
aa93d03ca9 Promote QgsDataItem enums to enum classes, move to Qgis 2021-05-27 13:38:54 +10:00
Denis Rouzaud
35c557a234 run sipify 2021-05-26 14:30:54 +02:00
Nyall Dawson
86b3459eea Add a flag which can be set on QgsSymbols to indicate that a renderer
should use symbol levels whenever that symbol is used by the renderer

Not exposed to users -- only settable via API, but IS saved in the
symbol's XML definition and restored when loading a symbol from XML.
2021-05-26 18:26:44 +10:00
Matthias Kuhn
92639aef64
Merge pull request #41208 from rldhont/flag-read-extent-from-xml
QgsMapLayer::ReadFlag::FlagReadExtentFromXml to extend vector layer read capabilities to other layer types
2021-05-26 10:14:04 +02:00
Nyall Dawson
68e7cd6609 Don't show symbol levels actions in renderer widgets for renderers
which are subrenderers for other renderers

Symbol layers have no effect in this situation (e.g. when a categorized
renderer is used as a subrenderer for point displacement renderer), so
don't show the option in the GUI
2021-05-26 11:50:44 +10:00
Nyall Dawson
f7f43e08c6 Fix memory leaks in renderer widgets 2021-05-26 11:50:44 +10:00
Nyall Dawson
f3f4c17c5f Use a safer approach to update renderers after symbol levels are changed
Instead of directly changing the renderer in place in the symbol levels
widget, we delegate responsibility for handling the changes to symbol
levels to the parent QgsRendererWidget subclass. This allows us to
implement different logic in the various subclasses which correctly
handle how that particular widget subclass should update any internal
symbol references and ultimately update the renderer.

Fixes instability and crashes after editing symbol levels.

Fixes #42671
2021-05-26 11:50:44 +10:00