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