Commit 56af485a authored by Clinton Stimpson's avatar Clinton Stimpson
Browse files

BUG: Consume all events for these widget types.

parent 1f2e9aae
......@@ -90,7 +90,7 @@ bool pqAbstractItemViewEventTranslator::translateEvent(QObject* Object, QEvent*
{
return false;
}
QMouseEvent* mouseEvent = dynamic_cast<QMouseEvent*>(Event);
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(Event);
if(Event->type() != QEvent::MouseButtonRelease)
{
this->LastPos = mouseEvent->pos();
......@@ -122,13 +122,12 @@ bool pqAbstractItemViewEventTranslator::translateEvent(QObject* Object, QEvent*
}
emit recordEvent(object, "mouseRelease", info);
}
return true;
}
default:
break;
}
return false;
return true;
}
......@@ -36,6 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QMouseEvent>
#include <QKeyEvent>
#include <QMenu>
#include <QMenuBar>
pqMenuEventTranslator::pqMenuEventTranslator(QObject* p)
: pqWidgetEventTranslator(p)
......@@ -50,8 +51,16 @@ bool pqMenuEventTranslator::translateEvent(QObject* Object, QEvent* Event,
bool& /*Error*/)
{
QMenu* const menu = qobject_cast<QMenu*>(Object);
if(!menu)
QMenuBar* const menubar = qobject_cast<QMenuBar*>(Object);
if(!menu && !menubar)
{
return false;
}
if(menubar)
{
return true;
}
if(Event->type() == QEvent::KeyPress)
{
......@@ -67,7 +76,6 @@ bool pqMenuEventTranslator::translateEvent(QObject* Object, QEvent* Event,
which = action->text();
}
emit recordEvent(menu, "activate", which);
return true;
}
}
}
......@@ -86,11 +94,10 @@ bool pqMenuEventTranslator::translateEvent(QObject* Object, QEvent* Event,
which = action->text();
}
emit recordEvent(menu, "activate", which);
return true;
}
}
}
return false;
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