Merge pull request #856 from MikeTheWatchGuy/Dev-latest

Combo - can now set default value
This commit is contained in:
MikeTheWatchGuy 2018-12-05 19:45:58 -05:00 committed by GitHub
commit 778339004a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -4599,8 +4599,14 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win):
element.QT_ComboBox.setDisabled(True)
element.QT_ComboBox.addItems(element.Values)
element.QT_ComboBox.setMaxVisibleItems(element.VisibleItems)
# element.QT_ComboBox.setVisible(element.VisibleItems) # does not look like the right use of this function!
if element.DefaultValue is not None:
for index, v in enumerate(element.Values):
if v == element.DefaultValue:
element.QT_ComboBox.setCurrentIndex(index)
break
if element.ChangeSubmits:
element.QT_ComboBox.currentIndexChanged.connect(element.QtCurrentItemChanged)
if element.Tooltip: