22910 Commits

Author SHA1 Message Date
Nyall Dawson
0f01dd3360 Stronger message 2024-01-19 19:44:48 +10:00
Nyall Dawson
c16a1e2b3d Update enums 2024-01-19 19:44:48 +10:00
Nyall Dawson
5ef1dcee64 Manually fix enum deprecated in qt5.9 2024-01-19 19:44:48 +10:00
Nyall Dawson
f8ad0d5f52 Manually fix an enum 2024-01-19 19:44:48 +10:00
Nyall Dawson
9fab1623a3 Update deprecated removed enum value 2024-01-19 19:44:48 +10:00
Nyall Dawson
4fc5138a28 Upgrade some enum members which are invisible to python introspection 2024-01-19 19:44:48 +10:00
Nyall Dawson
d7ae0aea25 + should not be used with flags 2024-01-19 19:44:48 +10:00
Nyall Dawson
23df946386 Handle QSci enums in pyqt5 to qt6 2024-01-19 19:44:48 +10:00
Nyall Dawson
77f289d32e Fix incorrect operator for flags 2024-01-19 19:44:48 +10:00
Nyall Dawson
29a87bf0fc Fix enums in console 2024-01-19 19:44:48 +10:00
Nyall Dawson
69df78e4fc Block PyQt5 imports in qt 6 builds, and vice versa 2024-01-19 19:44:48 +10:00
Nyall Dawson
8a4d42bbc0 Fix sip import 2024-01-19 19:44:48 +10:00
Nyall Dawson
585123a883 Add dox 2024-01-18 09:35:09 +10:00
Nyall Dawson
3e05a423d5 Refactor QgsProjectionSelectionWidget
Cleanup QgsProjectionSelectionWidget to use proper models to
drive the combo box. This removes a bunch of very fragile
logic regarding showing and hiding entries on demand, as it
allows us to move all the filtering logic to a single place
in a QSortFilterProxyModel subclass.

This has a few side benefits:
- The combos now dynamically respond to changes like recent
CRS being used in other places in QGIS
- The widget correctly respects horizontal/vertical crs filters
for all entries, including recent crs
2024-01-18 09:35:09 +10:00
Denis Rouzaud
2d47d612ce
make QgsAnnotationItem::clone const (#55868) 2024-01-17 14:31:30 +00:00
Denis Rouzaud
681376675b
make item method const (#55858) 2024-01-17 13:24:16 +01:00
Denis Rouzaud
d296f0e513
add enabled state for annotation items (#55798) 2024-01-17 10:07:10 +00:00
Nyall Dawson
e53e078bca Add proxy model for recent crs model 2024-01-17 10:16:32 +10:00
Nyall Dawson
7fcfd2b391 Create a basic model for recent coordinate reference systems 2024-01-17 10:16:32 +10:00
Nyall Dawson
ef4f8efdcc Remove unused 2018 WKT variants, monkey patch for api compatibility 2024-01-17 10:16:32 +10:00
Nyall Dawson
20075f8809 Use consistent case 2024-01-17 10:16:32 +10:00
Nyall Dawson
6c7cf97d85 Add signals for recent crs changes
And move tests to correct file
2024-01-17 10:16:32 +10:00
Nyall Dawson
f2903c7935 Move QgsCoordinateReferenceSystem enums to qgis, promote to enum class 2024-01-17 10:16:32 +10:00
Nyall Dawson
25fb7cefe1 Move recent crs methods to QgsCoordinateReferenceSystemRegistry 2024-01-17 10:16:32 +10:00
Nyall Dawson
fb1d3cc4bb Move all projection related gui files to src/gui/proj 2024-01-17 10:16:32 +10:00
Nyall Dawson
ddcc42ca85 Add filter options for all crs selection widgets
This is a partial implementation -- we also should be filtering
the lists of recent crs to matching ones
2024-01-17 10:16:32 +10:00
Nyall Dawson
da06bde051 Use double instead of float in high level class to avoid
user set values changing when saving/restoring material settings

Convert to float when creating low level, performance critical
objects only.
2024-01-16 13:20:47 +10:00
Nyall Dawson
2262aee293 Add a simple widget for setting percentage values via spin and slider 2024-01-16 13:20:47 +10:00
Nyall Dawson
0215bf01a3 Add API to control coefficients (strength) of ambient/diffuse/specular
contributions to phong shader
2024-01-16 13:20:47 +10:00
Julien Cabieces
1343d4e1ca [PyQt6] Remove failing null_from_qvariant_converter 2024-01-16 12:18:11 +10:00
Julien Cabieces
3e27ac5985 [PyQt6] Build PyQt6 2024-01-16 12:18:11 +10:00
Nyall Dawson
ad60cb3a26 [api] Add iface.blockActiveLayerChanges
Sets whether changes to the active layer should be temporarily
blocked. Exposes a previously private optimisation for use
by plugins.

This is a low-level method, designed to avoid unnecessary work when adding lots
of layers at once. Clients which will be adding many layers may call blockActiveLayerChanges( TRUE ) upfront,
add all the layers, and then follow up with a call to blockActiveLayerChanges( FALSE ). This will defer emitting
the active layer changed signal until they've added all layers, and only emit the signal once for
the final layer added.
2024-01-16 06:00:43 +10:00
Loïc Bartoletti
7bdf16d976 QgsAbstractGeometry: Update dox for fuzzyEqual and fix \see tags 2024-01-12 07:10:37 +10:00
Loïc Bartoletti
c16938c683 DOX: add a more descriptive information on fuzzyDistanceEqual. What is a 'distance comparison' 2024-01-12 07:10:37 +10:00
Loïc Bartoletti
c6eca9361f QgsAbstrcatGeometry and childs: Add fuzzyEqual and fuzzyDistanceEqual. Replaces operator== with fuzzyEqual and uses epsilon=1E-8
The comparisons among QGIS were conducted on coordinates using a fixed epsilon:
specifically, 1e-8 for QgsPoint and the default value for qgsDoubleNear: 4 *
DBL_EPSILON.

Initially, I've standardized its use to 1e-8 universally; it's already
significantly adequate for our Cartesian cases (1e-3 should suffice for many),
potentially fitting just right for geographical contexts.

Furthermore, in response to precision concerns, we're using the fuzzyEqual
and fuzzyDistanceEqual methods. These methods enable users/developers to
compare geometries more easily and with a given precision.

The API remains intact as operator==/equals() have been shifted into fuzzyEqual
(with an epsilon of 1e-8).

To consolidate the code between fuzzyEqual and fuzzyDistanceEqual, helper
functions, fuzzyHelpers, have been introduced following the logic of the
respective segments to be executed.
2024-01-12 07:10:37 +10:00
Nyall Dawson
9099fa4f3e Add a physically based metal rough material
Adds a new material choice for a physically based metal/roughness
material. Options are available for setting the material base color,
metalness and roughness.

Internally this uses a clone of Qt's QMetalRoughMaterial class. We
use a copy of the Qt class instead of relying on Qt's implementation
as longer-term improvements (such as data defined base color) will
require a re-implementation anyway. By using our own material we
will avoid having two different code paths for the data-defined/
non-data defined scenarios.
2024-01-11 11:43:01 +10:00
Loïc Bartoletti
c9d4a02d96 dox: Adds a \warning tag. Adds a mention about caller's responsibility and adds a \since tag 2024-01-11 05:23:39 +10:00
Loïc Bartoletti
a590b0e4c6 QgsGeometryUtils: add sqrDistance3D and distance3d for QgsPoint using QgsGeometryUtilsBase functions 2024-01-11 05:23:39 +10:00
Loïc Bartoletti
2fdcc3c01e QgsGeometryUtilsBase: add sqrDistance3D and distance3D
As for the sqrDistance and Distance 2D functions, this adds functions for 3D.
To maintain the lowest level, the specific case where a Z could be NaN
is not handled.
It is left to the responsibility of other methods using these functions.
2024-01-11 05:23:39 +10:00
Julien Cabieces
0e644d1889 [PyQt6] remove QTextCodec arg instead of removing the method 2024-01-11 04:52:01 +10:00
Julien Cabieces
fa6ab5c9a9 [PyQt6] Fix conversions.sip 2024-01-11 04:52:01 +10:00
Julien Cabieces
062ce03b6d [PyQt6] remove QTextCodec and rename pyqt5_from_qvariant_by_type
QTextCodec is no longer existing in PyQt6 (only in QtCoreCompat in C++)
2024-01-11 04:52:01 +10:00
Julien Cabieces
9d12ae8e6d [PyQt6] Add scope for enums and get rid of PyQt5.XXX import
this has been done automatically with the following comand line

./scripts/3to4/3to4.py --only-qgis3-compatible-changes ./python/plugins/
./scripts/3to4/3to4.py --only-qgis3-compatible-changes ./tests/src/python/
2024-01-10 21:15:27 +10:00
Nyall Dawson
13235351cd Perform backward compatibility of settings only for changed settings
The backward compatibility code is very expensive, as it triggers
a huge number of QSetting object creation and destruction.

We only need to perform this for settings which have changed,
so add API to flag changed settings and only perform backward
migration of changed settings.

This dramatically improves QgsApplication shutdown time (cuts
1.5 seconds off shutdown on a release build!!)
2024-01-10 18:19:56 +10:00
Nyall Dawson
976c86d03d Implement lazy initialization of default style library
Populating the style library from the database can be a time
consuming process, especially if a user has many symbols
present in their library.

But for many standalone scripts, and for qgis_process, the
style database may not be required.

Let's defer initialization of it until it's actually required,
saving the startup cost in qgis_process and 3rd party scripts.

On my system with a style database containing ~700 items this
cuts down qgis_process startup times by around 25%
2024-01-10 12:24:59 +10:00
Nyall Dawson
3c179214fc Use nicely formatted results in processing logs 2024-01-09 17:02:21 +10:00
Nyall Dawson
3e10cf9338 Add method to get HTML formatted versions of output values for
processing outputs
2024-01-09 17:02:21 +10:00
Nyall Dawson
b674a7c35d Add method to format processing output values as strings 2024-01-09 17:02:21 +10:00
Nyall Dawson
3e7d376953 Add method to push formatted text to Processing feedback
Provides a method for algorithms to push HTML contents to the log
(the other feedback methods all escape HTML strings to strip
formatting characters)
2024-01-09 17:02:21 +10:00
uclaros
c8468d45e0 cmon sip... 2024-01-08 05:20:26 -08:00