[Interest] Flush mouse events to a disabled widget!
lata.agrawal at enrouteinc.com
Fri Aug 3 23:42:25 CEST 2012
I have a Dialog with few buttons. When I disable the dialog, and I click on
a child button, nothing happens. But as soon as I enable the Dialog again,
the mouse event for the button is handled.
*Does disabling a Dialog simply delays handling of any mouse events for its
child widgets until enabled again? *
I tried installing event filters for child widgets when dialog is disabled
and then removing the event filters when enabled again. But it provides the
same behavior. As soon as dialog is enabled i.e. event filters for child
widgets removed, the mouse event (when disabled) are handled.
Can someone please help whats wrong here? Here is the code I wrote:
void MyDialog::changeEvent(QEvent *e)
if(e->type() == QEvent::EnabledChange)
bool MyDialog::eventFilter(QObject *obj, QEvent *e)
if(obj == ui->pbtnOption1 || obj == ui->pbtnOption2 || obj ==
if(e->type() == QEvent::MouseButtonPress)
return QDialog::eventFilter(obj, e);
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest