[Solved] QComboBox Questions
-
Hello,
I have two questions:
-
Is there a simple method to clear multiple QComboBox objects at once? I know how I can clear one using .clear() to clear the information in one object at a time.
-
Is there a simple method to copy the contents of one QComboBox to another, or multiple?
I know the long way of populating or clearing each QComboBox individually and I am wondering if there is a quicker solution.
Thanks in advance.
-
-
Hi,
-
Search for QComboBoxes using findChildren and loop over the returned list calling clear on each of them.
-
Create a QStringList from the content of the reference QComboBox and set it on the others using addItems (you can re-use the QComboBox list from 1)
Hope it helps
-
-
Thank you SGaist!
-
You're welcome !
If this answers your question, please update the thread title prepending [solved] so other forum users may know a solution has been found :)