PDA

View Full Version : Select item on double clicking in QComboBox



tommnaj
12th February 2012, 15:38
Hi everyone,

I have implemented tree view in ComboBox but when i am expanding the view the combobox popup closes, so i want first to select item from treeView and then on doubleclick that item should be selected.

Coul you please point me in right direction to do this?

Thanks

tommnaj
16th February 2012, 10:55
In case anybody crosses the same proble as i did - after a little more serching I think that there are at least two solutions to my question:
- install an event filter on the view for the combobox and when a mouse button release, you can eat the release mouse button event, so it would prevent it from closing the popup. Then on double click you call hidePopup()
- the second is to subclass QComboBox and its mouse release event, so hidePopup() is not call there.

If I am wrong about this please somebody correct me.