Commit 1897bd51 authored by Clinton Stimpson's avatar Clinton Stimpson
Browse files

BUG: consume all events for combo boxes and its children.

parent 14f61e2d
......@@ -43,31 +43,34 @@ pqComboBoxEventTranslator::pqComboBoxEventTranslator(QObject* p)
bool pqComboBoxEventTranslator::translateEvent(QObject* Object, QEvent* Event, bool& /*Error*/)
{
QComboBox* const object = qobject_cast<QComboBox*>(Object);
if(!object)
QComboBox* combo = NULL;
for(QObject* test = Object; combo == NULL && test != NULL; test = test->parent())
{
combo = qobject_cast<QComboBox*>(test);
}
if(!combo)
{
// not for me
return false;
switch(Event->type())
}
if(Event->type() == QEvent::Enter && Object == combo)
{
case QEvent::Enter:
if(this->CurrentObject != Object)
if(this->CurrentObject != Object)
{
if(this->CurrentObject)
{
if(this->CurrentObject)
{
disconnect(this->CurrentObject, 0, this, 0);
}
this->CurrentObject = Object;
connect(object, SIGNAL(destroyed(QObject*)), this, SLOT(onDestroyed(QObject*)));
connect(object, SIGNAL(activated(const QString&)), this, SLOT(onStateChanged(const QString&)));
connect(object, SIGNAL(editTextChanged(const QString&)), this, SLOT(onStateChanged(const QString&)));
disconnect(this->CurrentObject, 0, this, 0);
}
break;
default:
break;
this->CurrentObject = Object;
connect(combo, SIGNAL(destroyed(QObject*)), this, SLOT(onDestroyed(QObject*)));
connect(combo, SIGNAL(activated(const QString&)), this, SLOT(onStateChanged(const QString&)));
connect(combo, SIGNAL(editTextChanged(const QString&)), this, SLOT(onStateChanged(const QString&)));
}
}
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment