[Qt-interest] QComboBox Popup Access

Sean Hayes sean.t.hayes at Vanderbilt.Edu
Wed Oct 13 14:53:13 CEST 2010


On Wed, Oct 13, 2010 at 12:23 AM, Andre Somers <andre at familiesomers.nl> wrote:
>  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?

That is not exactly what I am after. The view() gives me access to
events that occur while I am interacting with the popup. However, when
the popup is open, any events that are generated from interacting with
any other widget are diverted to the QComboBoxPrivateContainer and
never arrive anywhere else. Is my understanding correct? I really need
to know if a mouse or touch event occurs in other parts of the
application while the QComboBox popup is visible.

Thanks,
     Sean

>
> André
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>




More information about the Qt-interest-old mailing list