Skip to content

Commit 800c632

Browse files
committed
Attempt
1 parent 35d8864 commit 800c632

File tree

8 files changed

+15
-1
lines changed

8 files changed

+15
-1
lines changed

python/PyQt6/core/auto_additions/qgis.py

+3
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,11 @@
396396
Qgis.PythonMacroMode.baseClass = Qgis
397397
QgsVectorDataProvider.FeatureCountState = Qgis.FeatureCountState
398398
# monkey patching scoped based enum
399+
Qgis.FeatureCountState.Uncounted.value = -2
399400
QgsVectorDataProvider.Uncounted = Qgis.FeatureCountState.Uncounted
400401
QgsVectorDataProvider.Uncounted.is_monkey_patched = True
401402
QgsVectorDataProvider.Uncounted.__doc__ = "Feature count not yet computed"
403+
Qgis.FeatureCountState.UnknownCount.value = -1
402404
QgsVectorDataProvider.UnknownCount = Qgis.FeatureCountState.UnknownCount
403405
QgsVectorDataProvider.UnknownCount.is_monkey_patched = True
404406
QgsVectorDataProvider.UnknownCount.__doc__ = "Provider returned an unknown feature count"
@@ -1465,6 +1467,7 @@
14651467
# --
14661468
Qgis.GnssConstellation.baseClass = Qgis
14671469
# monkey patching scoped based enum
1470+
Qgis.GpsQualityIndicator.Unknown.value = -1
14681471
Qgis.GpsQualityIndicator.Unknown.__doc__ = "Unknown"
14691472
Qgis.GpsQualityIndicator.Invalid.__doc__ = "Invalid"
14701473
Qgis.GpsQualityIndicator.GPS.__doc__ = "Standalone"

python/PyQt6/core/auto_additions/qgslayout.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
QgsLayout.ZViewTool = QgsLayout.ZValues.ZViewTool
99
QgsLayout.ZSnapIndicator = QgsLayout.ZValues.ZSnapIndicator
1010
QgsLayout.UndoLayoutDpi = QgsLayout.UndoCommand.UndoLayoutDpi
11+
QgsLayout.UndoCommand.UndoNone.value = -1
1112
QgsLayout.UndoNone = QgsLayout.UndoCommand.UndoNone

python/PyQt6/core/auto_additions/qgslayoutitem.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
QgsLayoutItem.LowerLeft = QgsLayoutItem.ReferencePoint.LowerLeft
99
QgsLayoutItem.LowerMiddle = QgsLayoutItem.ReferencePoint.LowerMiddle
1010
QgsLayoutItem.LowerRight = QgsLayoutItem.ReferencePoint.LowerRight
11+
QgsLayoutItem.UndoCommand.UndoNone.value = -1
1112
QgsLayoutItem.UndoNone = QgsLayoutItem.UndoCommand.UndoNone
1213
QgsLayoutItem.UndoIncrementalMove = QgsLayoutItem.UndoCommand.UndoIncrementalMove
1314
QgsLayoutItem.UndoIncrementalResize = QgsLayoutItem.UndoCommand.UndoIncrementalResize

python/PyQt6/core/auto_additions/qgslayoutmultiframe.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
QgsLayoutMultiFrame.UndoTableGridStrokeWidth = QgsLayoutMultiFrame.UndoCommand.UndoTableGridStrokeWidth
1515
QgsLayoutMultiFrame.UndoTableGridColor = QgsLayoutMultiFrame.UndoCommand.UndoTableGridColor
1616
QgsLayoutMultiFrame.UndoTableBackgroundColor = QgsLayoutMultiFrame.UndoCommand.UndoTableBackgroundColor
17+
QgsLayoutMultiFrame.UndoCommand.UndoNone.value = -1
1718
QgsLayoutMultiFrame.UndoNone = QgsLayoutMultiFrame.UndoCommand.UndoNone

python/PyQt6/core/auto_additions/qgsprocessing.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# The following has been generated automatically from src/core/processing/qgsprocessing.h
2+
QgsProcessing.SourceType.TypeMapLayer.value = -2
23
QgsProcessing.TypeMapLayer = QgsProcessing.SourceType.TypeMapLayer
4+
QgsProcessing.SourceType.TypeVectorAnyGeometry.value = -1
35
QgsProcessing.TypeVectorAnyGeometry = QgsProcessing.SourceType.TypeVectorAnyGeometry
46
QgsProcessing.TypeVectorPoint = QgsProcessing.SourceType.TypeVectorPoint
57
QgsProcessing.TypeVectorLine = QgsProcessing.SourceType.TypeVectorLine

python/PyQt6/core/auto_additions/qgsprocessingparameters.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def _force_int(v): return v if isinstance(v, int) else int(v.value)
2525
QgsProcessingParameterFile.Folder = QgsProcessingParameterFile.Behavior.Folder
2626
QgsProcessingParameterNumber.Integer = QgsProcessingParameterNumber.Type.Integer
2727
QgsProcessingParameterNumber.Double = QgsProcessingParameterNumber.Type.Double
28+
QgsProcessingParameterField.DataType.Any.value = -1
2829
QgsProcessingParameterField.Any = QgsProcessingParameterField.DataType.Any
2930
QgsProcessingParameterField.Numeric = QgsProcessingParameterField.DataType.Numeric
3031
QgsProcessingParameterField.String = QgsProcessingParameterField.DataType.String

python/PyQt6/gui/auto_additions/qgsmaptoolidentify.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# The following has been generated automatically from src/gui/qgsmaptoolidentify.h
2+
QgsMapToolIdentify.IdentifyMode.DefaultQgsSetting.value = -1
23
QgsMapToolIdentify.DefaultQgsSetting = QgsMapToolIdentify.IdentifyMode.DefaultQgsSetting
34
QgsMapToolIdentify.ActiveLayer = QgsMapToolIdentify.IdentifyMode.ActiveLayer
45
QgsMapToolIdentify.TopDownStopAtFirst = QgsMapToolIdentify.IdentifyMode.TopDownStopAtFirst

scripts/sipify.pl

+5-1
Original file line numberDiff line numberDiff line change
@@ -1216,15 +1216,19 @@ sub detect_non_method_member{
12161216
next if ($LINE =~ m/^\s*\w+\s*\|/); # multi line declaration as sum of enums
12171217

12181218
do {no warnings 'uninitialized';
1219-
my $enum_decl = $LINE =~ s/^(\s*(?<em>\w+))(\s+SIP_PYNAME(?:\(\s*(?<pyname>[^() ]+)\s*\)\s*)?)?(\s+SIP_MONKEY\w+(?:\(\s*(?<compat>[^() ]+)\s*\)\s*)?)?(?:\s*=\s*(?:[\w\s\d|+-]|::|<<)+)?(,?)(:?\s*\/\/!<\s*(?<co>.*)|.*)$/$1$3$7/r;
1219+
my $enum_decl = $LINE =~ s/^(\s*(?<em>\w+))(\s+SIP_PYNAME(?:\(\s*(?<pyname>[^() ]+)\s*\)\s*)?)?(\s+SIP_MONKEY\w+(?:\(\s*(?<compat>[^() ]+)\s*\)\s*)?)?(?:\s*=\s*(?<value>(?:[\w\s\d|+-]|::|<<)+))?(,?)(:?\s*\/\/!<\s*(?<co>.*)|.*)$/$1$3$8/r;
12201220
my $enum_member = $+{em};
12211221
my $comment = $+{co};
12221222
my $compat_name = $+{compat} ? $+{compat} : $enum_member;
1223+
my $enum_value = $+{value};
12231224
# replace :: with . (changes c++ style namespace/class directives to Python style)
12241225
$comment =~ s/::/./g;
12251226
$comment =~ s/\"/\\"/g;
12261227
$comment =~ s/\\since .*?([\d\.]+)/\\n.. versionadded:: $1\\n/i;
12271228
dbg_info("is_scope_based:$is_scope_based enum_mk_base:$enum_mk_base monkeypatch:$monkeypatch");
1229+
if ($is_qt6 and defined $enum_value && $enum_value =~ m/^[-+]?\d+$/ && $enum_value +0 < 0) {
1230+
push @OUTPUT_PYTHON, "$ACTUAL_CLASS.$enum_qualname.$enum_member.value = $enum_value\n";
1231+
}
12281232
if ($is_scope_based eq "1" and $enum_member ne "") {
12291233
if ( $monkeypatch eq 1 and $enum_mk_base ne ""){
12301234
if ( $ACTUAL_CLASS ne "" ) {

0 commit comments

Comments
 (0)