83 Commits

Author SHA1 Message Date
Nyall Dawson
6aae7380cd Cleanup int arguments which should be Qgis::RasterBandStatistic values
And ensure python compatibility remains intact
2024-02-02 04:59:04 +10:00
Nyall Dawson
503a95a1a1 Move enums to Qgis namespace for consistency 2024-02-02 04:59:04 +10:00
Nyall Dawson
179e2ca59a Promote some more enums to enum class to fix PyQt6 support 2024-02-02 04:59:04 +10:00
Nyall Dawson
fae7c83437 Fix doxygen 2024-01-31 17:16:18 +10:00
Nyall Dawson
f2c74f377d Sipify 2024-01-31 17:16:18 +10:00
Nyall Dawson
078fd4f2ea Make IntFlag enum type opt-in, rather than opt-out
And make sipify handle this nicely. This means that all our non-flag
style enums correctly map across to IntFlag python enums on Qt 6,
fixing issues with negative enum values for these and providing
a better match for the original c++ enum.
2024-01-31 17:16:18 +10:00
Nyall Dawson
12f4ce5978 Use correct enum type for enum with negative values 2024-01-31 17:16:18 +10:00
Nyall Dawson
f1e3ba9e2d Use correct sip method
And use INDENT-OFF annotations to avoid astyle messing up
formatting of enum with inline macros
2024-01-31 13:48:49 +10:00
Nyall Dawson
2d4c569b9c Fix build 2024-01-31 13:48:49 +10:00
Nyall Dawson
b5aca7c0b5 Promote another enum to enum class 2024-01-31 13:48:49 +10:00
Nyall Dawson
09578d6a8f Use templates to avoid ugly static_cast 2024-01-31 13:48:49 +10:00
Nyall Dawson
23f3af4290 Use enum classes for QgsProperty property keys
Should fix usage on Qt 6 builds
2024-01-31 13:48:49 +10:00
Alessandro Pasotti
27824078ad Introduce QgsProcessingProvider::Flag::FlagCompatibleWithVirtualRaster 2024-01-31 10:37:52 +10:00
Alexander Bruy
d9a0e1d4f9
Merge pull request #56057 from alexbruy/assistant-color-ramp-name
pass color ramp name to the color ramp transformer to generate correct expression (fix #48889)
2024-01-30 19:41:57 +02:00
Nyall Dawson
703612f539 Fix generic exception is raised on PyQt6 builds instead of specific
exceptions

QgsException MUST be the last type defined, or it greedily prevents
the more specialized exceptions from being raised in PyQGIS
2024-01-31 03:08:47 +10:00
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
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
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
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
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
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
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
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
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
1092e6dd8b Add isDeprecated method to QgsCoordinateReferenceSystem 2024-01-20 12:11:30 +10:00
Nyall Dawson
f25a87ea3f Correctly deprecate method 2024-01-20 12:11:30 +10:00
Juergen E. Fischer
d0e006861c fix windows build 2024-01-19 14:18:28 +01:00
Nyall Dawson
c16a1e2b3d Update enums 2024-01-19 19:44:48 +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
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
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