Permalink
Browse files

Combo - can now set default value

  • Loading branch information...
MikeTheWatchGuy committed Dec 6, 2018
1 parent 1e5f685 commit 7a2500ca109f3114028043045be577bd2099c43f
Showing with 7 additions and 1 deletion.
  1. +7 −1 PySimpleGUIQt/PySimpleGUIQt.py
@@ -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:

0 comments on commit 7a2500c

Please sign in to comment.