mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-26 00:22:10 -05:00
Fix setting default value for non-multiple enum params
This commit is contained in:
parent
26a97a7da7
commit
e35d1d0ed9
@ -116,6 +116,8 @@ class EnumModelerWidget(BASE, WIDGET):
|
||||
for i in range(model.rowCount()):
|
||||
item = model.item(i)
|
||||
if item.checkState() == Qt.Checked:
|
||||
if not self.allowMultiple():
|
||||
return i
|
||||
options.append(i)
|
||||
return options if len(options) > 0 else None
|
||||
|
||||
@ -134,7 +136,8 @@ class EnumModelerWidget(BASE, WIDGET):
|
||||
|
||||
def setDefault(self, indexes):
|
||||
model = self.lstItems.model()
|
||||
|
||||
if not isinstance(indexes, (list, tuple)):
|
||||
indexes = [indexes]
|
||||
for i in indexes:
|
||||
item = model.item(i)
|
||||
if item:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user