PDA

View Full Version : QComboBox Remove Item on Key_Delete press



ssal
1st October 2010, 15:09
Hi,

I am using PyQt ..

I want to remove an Item from the QComboBox drop down when it is highlighted and user
presses "Delete" key ...

What I am doing :

I reimplemented QComboBox and handled keyReleaseEvent but the issue here is that this event gets called only when I hit "Delete" on the comboBox lineEdit.


One way, I understand is that I can get the view using QComboBox.view(), attach a signal and slot to the view and handle that. But then what signal it should be and can I use "keyReleaseEvent" as slot ? .. I am little confused here.. :(

For interpretation, I see comboBox as combination of lineEdit and Drop down view...

Please let me know if I am unclear.