Tablet device_information manual test: show wheel events received

We have a bug that proximity events are generating them spuriously;
this is a way of testing it.

Task-number: QTBUG-52921
Change-Id: I490dfcf8d5b325f612b733e29fd49de9418bb19e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Shawn Rutledge 2016-04-22 13:25:16 +02:00 committed by Shawn Rutledge
parent 685dcd8527
commit 3d5e9a0ba1
2 changed files with 8 additions and 1 deletions

View File

@ -38,7 +38,7 @@
#include <QMetaObject>
#include <QMetaEnum>
TabletWidget::TabletWidget(bool mouseToo) : mMouseToo(mouseToo)
TabletWidget::TabletWidget(bool mouseToo) : mMouseToo(mouseToo), mWheelEventCount(0)
{
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
@ -87,6 +87,10 @@ bool TabletWidget::eventFilter(QObject *, QEvent *ev)
mGPos = event->globalPos();
mTimestamp = event->timestamp();
}
break;
case QEvent::Wheel:
++mWheelEventCount;
break;
default:
break;
}
@ -181,6 +185,8 @@ void TabletWidget::paintEvent(QPaintEvent *)
eventInfo << QString("z: %1").arg(QString::number(mZ));
eventInfo << QString("Unique Id: %1").arg(QString::number(mUnique));
eventInfo << QString("Total wheel events: %1").arg(QString::number(mWheelEventCount));
}
QString text = eventInfo.join("\n");

View File

@ -66,6 +66,7 @@ private:
qint64 mUnique;
bool mMouseToo;
ulong mTimestamp;
int mWheelEventCount;
};
#endif // TABLETWIDGET_H