Commit 85349b04 authored by Clinton Stimpson's avatar Clinton Stimpson
Browse files

ENH: Add support for unamed QToolButtons that have named actions.
     QToolBar->addAction() produces unamed QToolButtons.
parent 6f8c7b48
......@@ -10,6 +10,8 @@
#include "pqAbstractButtonEventTranslator.h"
#include <QAbstractButton>
#include <QToolButton>
#include <QAction>
#include <QEvent>
pqAbstractButtonEventTranslator::pqAbstractButtonEventTranslator() :
......@@ -45,7 +47,14 @@ bool pqAbstractButtonEventTranslator::translateEvent(QObject* Object, QEvent* Ev
void pqAbstractButtonEventTranslator::onClicked(bool)
{
emit recordEvent(this->CurrentObject, "activate", "");
if(this->CurrentObject->objectName() == QString::null && qobject_cast<QToolButton*>(this->CurrentObject))
{
emit recordEvent(qobject_cast<QToolButton*>(this->CurrentObject)->defaultAction(), "activate", "");
}
else
{
emit recordEvent(this->CurrentObject, "activate", "");
}
}
void pqAbstractButtonEventTranslator::onToggled(bool Checked)
......
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