23022 Commits

Author SHA1 Message Date
Alexander Bruy
0c338f1c09 address review 2024-01-30 14:55:58 +02:00
Alexander Bruy
81b1453b89 pass color ramp name to the color ramp transformer to generate correct
expression (fix #48889)
2024-01-30 14:55:27 +02:00
Nyall Dawson
b85db241c7 Sipify 2024-01-30 19:10:43 +10:00
Nyall Dawson
0aafdbfb77 Handle flags compatibility with older code when porting enums to enum
class on PyQt5 builds
2024-01-30 19:10:43 +10:00
Nyall Dawson
8e00d4befa Don't use raw ints as enum values 2024-01-30 19:10:43 +10:00
Nyall Dawson
c5978830c5 Add missing monkey patching 2024-01-30 19:10:43 +10:00
Nyall Dawson
6116319806 Move a processing enum to enum class in Qgis 2024-01-30 19:10:43 +10:00
Nyall Dawson
a36b203f30 Promote some processing enums to enum class, cleanups 2024-01-30 19:10:43 +10:00
Nyall Dawson
26798b84f4 Promote QgsFeatureRequest enums to enum class, move to Qgis 2024-01-30 19:10:43 +10:00
Nyall Dawson
38cff47c9e Fix flags bool operator on qt6 2024-01-30 14:49:54 +10:00
Alexander Bruy
35d8864fec add tests 2024-01-29 17:14:11 +01:00
Nyall Dawson
2bef88b031 Correctly add int types to flag style enum classes 2024-01-29 09:44:41 +01:00
Nyall Dawson
c1a47b2aa9 Sipify 2024-01-29 04:23:44 +10:00
Nyall Dawson
85b7a2c411 [sipify] Patch support for int based enum operations on non-enum class ints
sip6 converts all enums to python Enums, but ONLY creates
Enums with IntFlags types when the c++ type is an enum class : int.
Accordingly we need to patch back in all the operations which treat
enum values as ints, like |, &, bool, etc.

The long term solution here is to move all our c++ enums to enum
class, but that's not always straightforward and can break API
for plugins if it involves the signature of virtual methods.
2024-01-29 04:23:44 +10:00
Nyall Dawson
1cb1051528 Simplify code, make PyQt6 compatible 2024-01-28 13:33:23 +10:00
Nyall Dawson
59bd0befb5 Handle extended enum values for QNetworkReqest.setAttribute in PyQt6
Since this is an enum designed to be extended in c++ (eg by adding
values after Qt's user role), we have to do some fancy wrapping
in order to make these extended roles look like the types
acceptable to the PyQt function.

This has been designed to allow other functions to be wrapped
which rely on custom enum values.
2024-01-28 13:33:10 +10:00
Nyall Dawson
c950d978dc Update python/PyQt/PyQt/QtWidgets.py.in
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
2024-01-27 20:39:48 +10:00
Nyall Dawson
601854a790 Patch back in flags removed in PyQt6
PyQt6 explicitly removes QFlag types from Qt c++ classes whereas
these were exposed in PyQt5. Patch them back in for compatibility.
2024-01-27 20:39:48 +10:00
jmkerloch
0c0ffc818f feat(QgsLocatorWidget): add setPlaceholderText for lineedit 2024-01-26 08:42:01 +01:00
Alexander Bruy
79ccc22a5b
Merge pull request #55999 from alexbruy/mesh-renderer-settings-enum-fix
rename QgsMeshRendererScalarSettings.DataResampling enum value from None to NoResampling
2024-01-26 09:15:06 +02:00
Sandro Santilli
4fbc42fd2b Drop references to unused psycopg from db_manager 2024-01-25 18:03:38 +01:00
signedav
0fbdbc1255
Merge pull request #55633 from signedav/defaultsfix
Fix apply default values on update behavior
2024-01-25 15:02:19 +01:00
Nyall Dawson
fc3a60abf7 Fix PyQT6 null/None QVariant handling
Here we have to break with our previous approach of treating
null variants (NULL in Python) different to invalid qvariants (None in
Python)

There's simply NO way to construct null variants in PyQt6 -- they
are ALWAYS mapped across to Py_None.

This isn't as big a deal as it sounds, we already made the decision
in c++ code to move to invalid variants in favour of null variants.

Note that we STILL need the custom sip code here and can't rely
on base PyQt6 null variant conversion, as that relies on
QVariant::isNull when we must use QgsVariantUtils::isNull so
that the underlying type is correctly checked for null values
on Qt 6 builds.
2024-01-25 14:27:12 +01:00
Julien Cabieces
7eebe92b49
Merge pull request #55954 from nyalldawson/variant_type
Handle QVariant::Type in PyQt6 builds
2024-01-25 11:52:25 +01:00
signedav
70ba909484 Add version information 2024-01-25 10:52:45 +01:00
Mathieu Pellerin
51648deda1 Fix documentation of QgsDateEdit and QgsTimeEdit classes (fixes #55758) 2024-01-25 13:41:37 +10:00
Nyall Dawson
8c52728faf Remove server side filtering 2024-01-25 09:17:51 +10:00
Nyall Dawson
e90cb8c42d Don't try to load plugins which aren't compatible with qt 6
Add a plugin metadata key for "supports_qt6". Plugins which can
safely be loaded in QGIS builds based on Qt6 can set

    supportsQt6=yes

in their metadata.txt to advertise that they are safe to load
on Qt 6 builds
2024-01-25 09:17:51 +10:00
Mathieu Pellerin
c3738acb6f [processing] Regenerate primary key when running the dissolve algorithm (fixes #55587) 2024-01-25 06:06:56 +10:00
Alexander Bruy
b851e7cbe7 fix use of deprecated API in DB Manager (fix #54916) 2024-01-25 06:06:16 +10:00
signedav
6219271c05 Static function for volatile functions like rand, randf, now and uuid.
As well fixed, that widgets are considered that have no dependencies at all when they do have volantile functions.
2024-01-24 16:17:33 +01:00
Alexander Bruy
d8e21a8906 rename QgsMeshRendererScalarSettings enum value from None to NoResampling to avoid issues with Python bindings (fix #51033) 2024-01-24 14:52:19 +02:00
Nyall Dawson
ac2df03436
Monkey patch in QVariant::Type values for Qt6 builds
Since QVariant.Type doesn't exist in PyQt6, we patch it back
in by setting them to their QMetaType.Type equivalents.

This means that code which calls eg:

   field = QgsField('my_field', QVariant.Int)

will work as usual under Qt5, while on Qt6 builds it will work
without change. (Since QVariant.Int is QMetaType.Type.Int, and
the PyQGIS6 sip conversion code will kick in and transparently
convert the QMetaType.Type.Int value to QVariant::Int when
calling the underlying c++ method)
2024-01-24 09:49:43 +10:00
Nyall Dawson
a672c63e6e
Add sip MappedType for QVariant::Type for Qt6
QVariant::Type does not exist in PyQt6 as its been deprecated
and replaced with QMetaType::Type.

In order to avoid breaking PyQGIS API, we don't want to change
all our functions to use QMetaType::Type instead of QVariant::Type
(that can wait till QGIS 4.0). So instead we leave the c++/Qt 5
signatures as QVariant::Type, but accept QMetaType::Type values
for these functions under Qt 6 builds.
2024-01-24 09:49:43 +10:00
Nyall Dawson
3dc17faca6
Add utilities to convert between QMetaType::Type and QVariant::Type
While QVariant::Type can be directly static_cast to QMetaType::Type,
the reverse is not true and many QMetaType::Type values don't
have exact counterparts in QVariant::Type.

So we use the logic:

- If no conversion is possible, QVariant::UserType will be returned.
  Note that we don't use QVariant::Invalid, as the value DOES have
  a type, it's just one which needs special handling (just like user
  types do)
- Some conversions are lossy, in that the QVariant::Type cannot
  represent the full range of values possible in QMetaType::Type.
  In these cases the returned type will be an "expanded" type
  capable of storing the full range of values possible in the
  original type. Eg we map QMetaType::Type::Float to QVariant::Type::Double

QgsVariantUtils::variantTypeToMetaType is included for clarity/
completeness/future proof-ness, even though it currently can
be handled with just a simple static cast.
2024-01-24 09:49:43 +10:00
Nyall Dawson
169f4e1b85 Update most python tests to use base class render check methods 2024-01-23 16:25:52 +01:00
Nyall Dawson
fcdf6aa76e Fix QList/QVector<QVariantMap> conversion 2024-01-23 08:32:38 +01:00
Nyall Dawson
4654ad3db5 Sipify 2024-01-23 08:32:38 +01:00
Nyall Dawson
28cc55a67c Make sip method code compatible with Qt6 2024-01-23 08:32:38 +01:00
Nyall Dawson
62206e318e Fix QColor repr 2024-01-23 14:44:51 +10:00
Nyall Dawson
8eb8d612b3 Modernize some tests 2024-01-23 09:01:55 +10:00
Nyall Dawson
dd2f8a9d01 Upgrade enums 2024-01-22 19:02:40 +10:00
Mathieu Pellerin
185724f892 Make QtPrinter support non-mandatory 2024-01-22 11:07:34 +10:00
Nyall Dawson
e42abf7dc5 Update python files 2024-01-22 05:46:15 +10:00
Nyall Dawson
9a752b9bea exec() works in PyQt5 2024-01-22 05:46:15 +10:00
Nyall Dawson
e1965014f0 Use .exec() in example code 2024-01-22 05:46:15 +10:00
Nyall Dawson
b5a706ff13 Fix seealso links 2024-01-20 12:11:30 +10:00
Nyall Dawson
cf0e101664 Remove broken see also links 2024-01-20 12:11:30 +10:00
Nyall Dawson
9f877df4d6 Use proper model for recent CRS in QgsProjectionSelectionTreeWidget
This ensures that we correctly apply filters to recent projections
too, eg so that a widget showing only vertical crs will ONLY show
recent VERTICAL crs, not every recent crs.
2024-01-20 12:11:30 +10:00
Nyall Dawson
1092e6dd8b Add isDeprecated method to QgsCoordinateReferenceSystem 2024-01-20 12:11:30 +10:00