All examples or documentation on PyQt5 QInputDialog I found, used simple classic lists limited to only one item per "row" (like in my code example ("Red","Blue" or "Green")).
I am searching for a good way to build a more detailed multidimensional list, like a table, where the user gets to see and select the whole row (with multiple values as one item) in the input dialog instead of a single value.
For example a nested list like that: [['Ryan', 24, 'm'], ['Lisa', 22, 'f'], ['Joe', 30, 'm']]
--> Imagine each one of the three lists in the list should be one row (entry) in the QInputDialog that can be selected. Like in a table with a checkbox for each row.
Is something like that possible? Anyone knows?
#The normal (limited) version with a simple list I am referring to looks like that:
def getChoice(self):
itemlist = ("Red","Blue","Green")
item, okPressed = QInputDialog.getItem(self, "Get item","Color:", itemlist, 0, False)
if okPressed and item:
print(item)
The
join()
method takes all items in an iterable and joins them into one string.Syntax:
string.join(iterable)