[PyQt] QComboBox with history

Filip Gruszczyński gruszczy at gmail.com
Thu Jul 3 16:42:39 BST 2008

Oh, and I could just override hidePopup() but that's just not the
right place. It should be in just the place, where user hits
enter/left key and new option in the combo box is chosen.

But I will use hidePopup() unless I find something better :-/

2008/7/3 Filip Gruszczyński <gruszczy at gmail.com>:
>> For example, you can use userData attribute in the addItem() method or the
>> setItemData() method to store the information needed and the findData method
>> to find an item or an index with needed data. More information on the
>> QComboBox Class Reference.
> I don't think it solves my problem. What I want (need) to do, is add
> history of user's choices. Say, there are values a, b and c in the
> combo box. First user chooses a, but then changes to c. I would like
> to store this information and be able to retrieve whole (or part) of
> the history - e.g. [ a, c ].
> Therefore I need to intercept the event when user chooses new option
> in the combo box, add information to the history and then let the rest
> happen (like emitting signals). I can't just intercept a signal,
> because I have no control over order of interception.
> --
> Filip Gruszczyński

Filip Gruszczyński

More information about the PyQt mailing list