Type of Issue (Enhancement, Error, Bug, Question)
Question
Operating System
WIN10
PySimpleGUI Port (tkinter, Qt, Wx, Web)
Qt
Versions
Version information can be obtained by calling sg.main_get_debug_data()
Or you can print each version shown in ()
Python version (sg.sys.version)
Python 3.9.13
PySimpleGUI Version (sg.__version__)
5.0.0
GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)
PySide2/PySide6
GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)
PySide2/PySide6
Priority Support Code (Commercial Users)
Your Experience In Months or Years (optional)
5+ Years Python programming experience
10+ Years Programming experience overall
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
tkinter
Anything else you think would be helpful?
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
PySide2.QtWidgets.QComboBox.addItems(texts)
Parameters:
PySimpleGUI/tkinter can accept objects as values of widget, but PySimpleGUIQt/PySide cannot.
- Source code when initiate a Combobox, and it's fine.
items_as_strings = [str(v) for v in element.Values]
# element.QT_ComboBox.addItems(element.Values)
element.QT_ComboBox.addItems(items_as_strings)
- Source code when update a Combobox
self.QT_ComboBox.addItems(values)
You can find that there's no code to converts values to a list of str in PySimpleGUIQt.py when update, so we need to do it by ourself, or new values will be shown as blank lines in the Combobox element after updated.
Code To Duplicate
import PySimpleGUIQt as sg
class Point:
def __init__(self, location) -> None:
self.location = location
def __str__(self) -> str:
return f"Location {self.location}"
points = [Point(i) for i in range(5)]
window = sg.Window("Title", [[sg.Combo([0,1,2,3,4], key='COMBO')]], finalize=True)
window['COMBO'].update(values=points)
# window['COMBO'].update(values=tuple(map(str, points)))
window.read(close=True)
Screenshot, Sketch, or Drawing
Watcha Makin?
If you care to share something about your project, it would be awesome to hear what you're building.
Type of Issue (Enhancement, Error, Bug, Question)
Question
Operating System
WIN10
PySimpleGUI Port (tkinter, Qt, Wx, Web)
Qt
Versions
Version information can be obtained by calling
sg.main_get_debug_data()Or you can print each version shown in ()
Python version (
sg.sys.version)Python 3.9.13
PySimpleGUI Version (
sg.__version__)5.0.0
GUI Version (tkinter (
sg.tclversion_detailed), PySide2, WxPython, Remi)PySide2/PySide6
GUI Version (tkinter (
sg.tclversion_detailed), PySide2, WxPython, Remi)PySide2/PySide6
Priority Support Code (Commercial Users)
Your Experience In Months or Years (optional)
5+ Years Python programming experience
10+ Years Programming experience overall
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
tkinter
Anything else you think would be helpful?
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
PySimpleGUI/tkinter can accept objects as values of widget, but PySimpleGUIQt/PySide cannot.
You can find that there's no code to converts values to a list of
strin PySimpleGUIQt.py when update, so we need to do it by ourself, or new values will be shown as blank lines in the Combobox element after updated.Code To Duplicate
Screenshot, Sketch, or Drawing
Watcha Makin?
If you care to share something about your project, it would be awesome to hear what you're building.