Commit c0cf2856 authored by Alvin Wong's avatar Alvin Wong

Improve logging of tablet proximity events

parent 512be25c
......@@ -40,12 +40,22 @@ bool TabletTestDialog::eventFilter(QObject *watched, QEvent *e) {
Q_UNUSED(watched);
if(e->type() == QEvent::TabletEnterProximity || e->type() == QEvent::TabletLeaveProximity) {
QTabletEvent *te = static_cast<QTabletEvent*>(e);
bool near = te->pointerType()==QTabletEvent::Eraser;
bool isEraser = te->pointerType() == QTabletEvent::Eraser;
bool isNear = e->type() == QEvent::TabletEnterProximity;
QString msg;
if(near)
if(isEraser) {
if (isNear) {
msg = QStringLiteral("Eraser brought near");
else
} else {
msg = QStringLiteral("Eraser taken away");
}
} else {
if (isNear) {
msg = QStringLiteral("Pen tip brought near");
} else {
msg = QStringLiteral("Pen tip taken away");
}
}
m_ui->logView->appendPlainText(msg);
}
......
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