From 16bf3489c6b5f6e2dc5411aef65d6943608cc5a0 Mon Sep 17 00:00:00 2001 From: marian Date: Sun, 14 Jun 2009 21:11:25 +0000 Subject: [PATCH] Don't trigger existing disabled actions/widgets from event filter. git-svn-id: http://voip.null.ro/svn/yate@2709 acf43c95-373e-0410-b603-e72c3f656dc1 --- clients/qt4/qt4client.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/clients/qt4/qt4client.cpp b/clients/qt4/qt4client.cpp index ad039dd1..5feec72b 100644 --- a/clients/qt4/qt4client.cpp +++ b/clients/qt4/qt4client.cpp @@ -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(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; } }