Don't trigger existing disabled actions/widgets from event filter.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2709 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2009-06-14 21:11:25 +00:00
parent 2f76d754bf
commit 207cfef1f2
1 changed files with 11 additions and 1 deletions

View File

@ -2072,7 +2072,17 @@ bool QtWindow::eventFilter(QObject* obj, QEvent* event)
// Check if we should let the control process the key
QVariant v = wid->property(prop + "Filter");
bool ret = ((v.type() == QVariant::Bool) ? v.toBool() : false);
Client::self()->action(this,action);
QObject* obj = qFindChild<QObject*>(this,QtClient::setUtf8(action));
bool trigger = true;
if (obj) {
QtWidget w(this,action);
if (w.widget())
trigger = w.widget()->isEnabled();
else if (w.type() == QtWidget::Action)
trigger = w.action()->isEnabled();
}
if (trigger)
Client::self()->action(this,action);
return ret;
}
}