[Qt-interest] QComboBox Popup Access

Andre Somers andre at familiesomers.nl
Wed Oct 13 07:23:56 CEST 2010


  Op 13-10-2010 4:43, Sean Hayes schreef:
> I am trying to get a QComboBox derivative to work with a QGesture
> rather than mouse events. To do this I will use on gesture to open
> show the popup and another to select an item. To do this, I need
> access to the events that normally get taken up by the popup. Is there
> a way to get access to the popup and apply a event filter to it? I see
> that it is a QComboBoxPrivateContainer and I do not have any access to
> it. However, it seems that there should be a way to get access to any
> events associated with the QComboBox. Below is my attempt to access
> the container. Unfortunately, I need access to the popup before the
> first hidePopup() call. Is there a way to prevent the popup from
> taking all the events when it is open?
Well, actually, you do have access to the different parts of a QComboBox 
via public API. The line edit can be accessed via the lineEdit() method, 
and the list part via the view() method.

You should be able to install an eventfilter on either of them. Is that 
what you were after?

André





More information about the Qt-interest-old mailing list