diff --git a/python/PyQt6/core/auto_generated/qgsoptionalexpression.sip.in b/python/PyQt6/core/auto_generated/qgsoptionalexpression.sip.in index 29b1adc2eebe0..aba68641b106b 100644 --- a/python/PyQt6/core/auto_generated/qgsoptionalexpression.sip.in +++ b/python/PyQt6/core/auto_generated/qgsoptionalexpression.sip.in @@ -13,7 +13,7 @@ -typedef QgsOptional QgsOptionalQgsExpressionBase; +typedef QgsOptional QgsOptionalQgsExpressionBase /NoTypeName/; class QgsOptionalExpression : QgsOptionalQgsExpressionBase { diff --git a/python/PyQt6/core/auto_generated/qgsrange.sip.in b/python/PyQt6/core/auto_generated/qgsrange.sip.in index a89baa4ad5586..45ef0c252ec1a 100644 --- a/python/PyQt6/core/auto_generated/qgsrange.sip.in +++ b/python/PyQt6/core/auto_generated/qgsrange.sip.in @@ -141,7 +141,7 @@ Returns ``True`` if this range overlaps another range. -typedef QgsRange QgsRangedoubleBase; +typedef QgsRange QgsRangedoubleBase /NoTypeName/; class QgsDoubleRange : QgsRangedoubleBase { @@ -210,7 +210,7 @@ Returns ``True`` if the range consists of all possible values. -typedef QgsRange QgsRangeintBase; +typedef QgsRange QgsRangeintBase /NoTypeName/; class QgsIntRange : QgsRangeintBase { diff --git a/python/PyQt6/core/auto_generated/settings/qgssettingsentryimpl.sip.in b/python/PyQt6/core/auto_generated/settings/qgssettingsentryimpl.sip.in index 486f7370d3f3c..b48296c9db692 100644 --- a/python/PyQt6/core/auto_generated/settings/qgssettingsentryimpl.sip.in +++ b/python/PyQt6/core/auto_generated/settings/qgssettingsentryimpl.sip.in @@ -9,7 +9,7 @@ -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQVariantBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQVariantBase /NoTypeName/; class QgsSettingsEntryVariant : QgsSettingsEntryBaseTemplateQVariantBase { @@ -110,7 +110,7 @@ Returns settings value. }; -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQStringBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQStringBase /NoTypeName/; class QgsSettingsEntryString : QgsSettingsEntryBaseTemplateQStringBase { @@ -211,7 +211,7 @@ Returns the string maximum length. By -1 there is no limitation. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQStringListBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQStringListBase /NoTypeName/; class QgsSettingsEntryStringList : QgsSettingsEntryBaseTemplateQStringListBase { @@ -289,7 +289,7 @@ This constructor is intended to be used from plugins. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateboolBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateboolBase /NoTypeName/; class QgsSettingsEntryBool : QgsSettingsEntryBaseTemplateboolBase { @@ -367,7 +367,7 @@ This constructor is intended to be used from plugins. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateintBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateintBase /NoTypeName/; class QgsSettingsEntryInteger : QgsSettingsEntryBaseTemplateintBase { @@ -470,7 +470,7 @@ Returns the maximum value. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplatedoubleBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplatedoubleBase /NoTypeName/; class QgsSettingsEntryDouble : QgsSettingsEntryBaseTemplatedoubleBase { @@ -595,7 +595,7 @@ Returns how much decimals should be shown in the Gui. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQColorBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQColorBase /NoTypeName/; class QgsSettingsEntryColor : QgsSettingsEntryBaseTemplateQColorBase { @@ -689,7 +689,7 @@ Returns ``True`` if transparency is allowed for the color }; -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQVariantMapBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQVariantMapBase /NoTypeName/; class QgsSettingsEntryVariantMap : QgsSettingsEntryBaseTemplateQVariantMapBase { diff --git a/python/PyQt6/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in b/python/PyQt6/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in index ccb7afcf5cfe4..ac48827245c89 100644 --- a/python/PyQt6/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in +++ b/python/PyQt6/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in @@ -75,7 +75,7 @@ Returns the layer id of the source layer. }; -typedef QgsAbstractFeatureIteratorFromSource QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase; +typedef QgsAbstractFeatureIteratorFromSource QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase /NoTypeName/; class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase { diff --git a/python/PyQt6/gui/auto_generated/settings/qgssettingseditorwidgetwrapperimpl.sip.in b/python/PyQt6/gui/auto_generated/settings/qgssettingseditorwidgetwrapperimpl.sip.in index 2301afdb08a3e..f4aad133b451c 100644 --- a/python/PyQt6/gui/auto_generated/settings/qgssettingseditorwidgetwrapperimpl.sip.in +++ b/python/PyQt6/gui/auto_generated/settings/qgssettingseditorwidgetwrapperimpl.sip.in @@ -76,7 +76,7 @@ To be re-implemented to implemeent type specific configuration (e.g. opacity for -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQLineEditQStringBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQLineEditQStringBase /NoTypeName/; class QgsSettingsStringLineEditWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQLineEditQStringBase { @@ -122,7 +122,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQComboBoxQStringBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQComboBoxQStringBase /NoTypeName/; class QgsSettingsStringComboBoxWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQComboBoxQStringBase { @@ -179,7 +179,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryBoolQCheckBoxboolBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryBoolQCheckBoxboolBase /NoTypeName/; class QgsSettingsBoolCheckBoxWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryBoolQCheckBoxboolBase { @@ -223,7 +223,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` }; -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryIntegerQSpinBoxintBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryIntegerQSpinBoxintBase /NoTypeName/; class QgsSettingsIntegerSpinBoxWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryIntegerQSpinBoxintBase { @@ -268,7 +268,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryDoubleQDoubleSpinBoxdoubleBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryDoubleQDoubleSpinBoxdoubleBase /NoTypeName/; class QgsSettingsDoubleSpinBoxWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryDoubleQDoubleSpinBoxdoubleBase { @@ -313,7 +313,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryColorQgsColorButtonQColorBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryColorQgsColorButtonQColorBase /NoTypeName/; class QgsSettingsColorButtonWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryColorQgsColorButtonQColorBase { diff --git a/python/core/auto_generated/qgsoptionalexpression.sip.in b/python/core/auto_generated/qgsoptionalexpression.sip.in index 29b1adc2eebe0..aba68641b106b 100644 --- a/python/core/auto_generated/qgsoptionalexpression.sip.in +++ b/python/core/auto_generated/qgsoptionalexpression.sip.in @@ -13,7 +13,7 @@ -typedef QgsOptional QgsOptionalQgsExpressionBase; +typedef QgsOptional QgsOptionalQgsExpressionBase /NoTypeName/; class QgsOptionalExpression : QgsOptionalQgsExpressionBase { diff --git a/python/core/auto_generated/qgsrange.sip.in b/python/core/auto_generated/qgsrange.sip.in index a89baa4ad5586..45ef0c252ec1a 100644 --- a/python/core/auto_generated/qgsrange.sip.in +++ b/python/core/auto_generated/qgsrange.sip.in @@ -141,7 +141,7 @@ Returns ``True`` if this range overlaps another range. -typedef QgsRange QgsRangedoubleBase; +typedef QgsRange QgsRangedoubleBase /NoTypeName/; class QgsDoubleRange : QgsRangedoubleBase { @@ -210,7 +210,7 @@ Returns ``True`` if the range consists of all possible values. -typedef QgsRange QgsRangeintBase; +typedef QgsRange QgsRangeintBase /NoTypeName/; class QgsIntRange : QgsRangeintBase { diff --git a/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in b/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in index c1dfe2013c808..ae974060c967e 100644 --- a/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in +++ b/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in @@ -9,7 +9,7 @@ -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQVariantBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQVariantBase /NoTypeName/; class QgsSettingsEntryVariant : QgsSettingsEntryBaseTemplateQVariantBase { @@ -110,7 +110,7 @@ Returns settings value. }; -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQStringBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQStringBase /NoTypeName/; class QgsSettingsEntryString : QgsSettingsEntryBaseTemplateQStringBase { @@ -211,7 +211,7 @@ Returns the string maximum length. By -1 there is no limitation. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQStringListBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQStringListBase /NoTypeName/; class QgsSettingsEntryStringList : QgsSettingsEntryBaseTemplateQStringListBase { @@ -289,7 +289,7 @@ This constructor is intended to be used from plugins. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateboolBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateboolBase /NoTypeName/; class QgsSettingsEntryBool : QgsSettingsEntryBaseTemplateboolBase { @@ -367,7 +367,7 @@ This constructor is intended to be used from plugins. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateintBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateintBase /NoTypeName/; class QgsSettingsEntryInteger : QgsSettingsEntryBaseTemplateintBase { @@ -470,7 +470,7 @@ Returns the maximum value. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplatedoubleBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplatedoubleBase /NoTypeName/; class QgsSettingsEntryDouble : QgsSettingsEntryBaseTemplatedoubleBase { @@ -595,7 +595,7 @@ Returns how much decimals should be shown in the Gui. -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQColorBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQColorBase /NoTypeName/; class QgsSettingsEntryColor : QgsSettingsEntryBaseTemplateQColorBase { @@ -689,7 +689,7 @@ Returns ``True`` if transparency is allowed for the color }; -typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQVariantMapBase; +typedef QgsSettingsEntryBaseTemplate QgsSettingsEntryBaseTemplateQVariantMapBase /NoTypeName/; class QgsSettingsEntryVariantMap : QgsSettingsEntryBaseTemplateQVariantMapBase { diff --git a/python/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in b/python/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in index ccb7afcf5cfe4..ac48827245c89 100644 --- a/python/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in +++ b/python/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in @@ -75,7 +75,7 @@ Returns the layer id of the source layer. }; -typedef QgsAbstractFeatureIteratorFromSource QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase; +typedef QgsAbstractFeatureIteratorFromSource QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase /NoTypeName/; class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase { diff --git a/python/gui/auto_generated/settings/qgssettingseditorwidgetwrapperimpl.sip.in b/python/gui/auto_generated/settings/qgssettingseditorwidgetwrapperimpl.sip.in index 9d9e197c8dd25..c1be717961098 100644 --- a/python/gui/auto_generated/settings/qgssettingseditorwidgetwrapperimpl.sip.in +++ b/python/gui/auto_generated/settings/qgssettingseditorwidgetwrapperimpl.sip.in @@ -76,7 +76,7 @@ To be re-implemented to implemeent type specific configuration (e.g. opacity for -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQLineEditQStringBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQLineEditQStringBase /NoTypeName/; class QgsSettingsStringLineEditWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQLineEditQStringBase { @@ -122,7 +122,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQComboBoxQStringBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQComboBoxQStringBase /NoTypeName/; class QgsSettingsStringComboBoxWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQComboBoxQStringBase { @@ -179,7 +179,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryBoolQCheckBoxboolBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryBoolQCheckBoxboolBase /NoTypeName/; class QgsSettingsBoolCheckBoxWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryBoolQCheckBoxboolBase { @@ -223,7 +223,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` }; -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryIntegerQSpinBoxintBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryIntegerQSpinBoxintBase /NoTypeName/; class QgsSettingsIntegerSpinBoxWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryIntegerQSpinBoxintBase { @@ -268,7 +268,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryDoubleQDoubleSpinBoxdoubleBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryDoubleQDoubleSpinBoxdoubleBase /NoTypeName/; class QgsSettingsDoubleSpinBoxWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryDoubleQDoubleSpinBoxdoubleBase { @@ -313,7 +313,7 @@ Constructor of the wrapper for a given ``setting`` and its widget ``editor`` -typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryColorQgsColorButtonQColorBase; +typedef QgsSettingsEditorWidgetWrapperTemplate QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryColorQgsColorButtonQColorBase /NoTypeName/; class QgsSettingsColorButtonWrapper : QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryColorQgsColorButtonQColorBase { diff --git a/scripts/sipify.py b/scripts/sipify.py index 517d1da9808fc..40d8545c4b348 100755 --- a/scripts/sipify.py +++ b/scripts/sipify.py @@ -1884,7 +1884,8 @@ def cpp_to_python_signature(cpp_function: str) -> str: f'\n%TypeHeaderCode\n#include "{os.path.basename(CONTEXT.header_file)}"' ) - # for template based inheritance, add a typedef to define the base type + # for template based inheritance, add a typedef to define the base type, + # since SIP doesn't allow inheriting from template classes directly while template_inheritance_template: tpl = template_inheritance_template.pop() cls1 = template_inheritance_class1.pop() @@ -1892,11 +1893,12 @@ def cpp_to_python_signature(cpp_function: str) -> str: cls3 = template_inheritance_class3.pop() if cls2 == "": - CONTEXT.current_line = f"\ntypedef {tpl}<{cls1}> {tpl}{cls1}Base;\n\n{CONTEXT.current_line}" + # We use /NoTypeName/ to say that this typedef is not present in actual QGIS headers + CONTEXT.current_line = f"\ntypedef {tpl}<{cls1}> {tpl}{cls1}Base /NoTypeName/;\n\n{CONTEXT.current_line}" elif cls3 == "": - CONTEXT.current_line = f"\ntypedef {tpl}<{cls1},{cls2}> {tpl}{cls1}{cls2}Base;\n\n{CONTEXT.current_line}" + CONTEXT.current_line = f"\ntypedef {tpl}<{cls1},{cls2}> {tpl}{cls1}{cls2}Base /NoTypeName/;\n\n{CONTEXT.current_line}" else: - CONTEXT.current_line = f"\ntypedef {tpl}<{cls1},{cls2},{cls3}> {tpl}{cls1}{cls2}{cls3}Base;\n\n{CONTEXT.current_line}" + CONTEXT.current_line = f"\ntypedef {tpl}<{cls1},{cls2},{cls3}> {tpl}{cls1}{cls2}{cls3}Base /NoTypeName/;\n\n{CONTEXT.current_line}" if tpl not in CONTEXT.declared_classes: tpl_header = f"{tpl.lower()}.h"