Commit 5731bd04 authored by Benjamin Long's avatar Benjamin Long

Make sure recorded delta associated with MouseWheel are +/-120

The delta associated with Qt Mouse Wheel is sometimes greater than 120
(for example when the wheel is turned very fast). This is expected.
From our observation, it seems additional event are also emitted/recorded.

Further investigation are needed to exactly identified the issue.
The CTK issue #132 will allow us to track that problem.
parent d918b29b
......@@ -151,7 +151,7 @@ bool pqAbstractItemViewEventTranslator::translateEvent(QObject* Object, QEvent*
idxStr = toIndexStr(idx);
QRect r = object->visualRect(idx);
relPt = wheelEvent->pos() - r.topLeft();
int numStep = wheelEvent->delta();
int numStep = wheelEvent->delta() > 0 ? 120 : -120;
int buttons = wheelEvent->buttons();
int modifiers = wheelEvent->modifiers();
emit emit recordEvent(Object, "mouseWheel", QString("%1,%2,%3,%4,%5")
......
......@@ -102,8 +102,9 @@ bool pqBasicWidgetEventTranslator::translateEvent(QObject* Object,
{
int buttons = wheelEvent->buttons();
int modifiers = wheelEvent->modifiers();
int numStep = wheelEvent->delta() > 0 ? 120 : -120;
emit emit recordEvent(Object, "mouseWheel", QString("%1,%2,%3,%4,%5")
.arg(wheelEvent->delta())
.arg(numStep)
.arg(buttons)
.arg(modifiers)
.arg(wheelEvent->x())
......
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