From eed0c9b35ba0cf8536e95e98f56b028287256915 Mon Sep 17 00:00:00 2001 From: Huan Truong Date: Sat, 31 Mar 2018 02:08:45 -0400 Subject: [PATCH] [code] more debugging for touchscreen detection --- src/autoapp/Configuration/Configuration.cpp | 8 ++++++++ src/autoapp/autoapp.cpp | 1 + 2 files changed, 9 insertions(+) diff --git a/src/autoapp/Configuration/Configuration.cpp b/src/autoapp/Configuration/Configuration.cpp index 33dc1a3..4430d01 100644 --- a/src/autoapp/Configuration/Configuration.cpp +++ b/src/autoapp/Configuration/Configuration.cpp @@ -160,8 +160,16 @@ void Configuration::save() bool Configuration::hasTouchScreen() const { auto touchdevs = QTouchDevice::devices(); + + OPENAUTO_LOG(info) << "[Touchdev] " << + "Querying available touch devices [" << + touchdevs.length() << " available]"; + for (int i = 0; i < touchdevs.length(); i++) { if (touchdevs[i]->type() == QTouchDevice::TouchScreen) { + OPENAUTO_LOG(info) << "[Touchdev] Device " << i << + ": " << touchdevs[i]->name().toStdString() << + ", type " << touchdevs[i]->type(); return true; } } diff --git a/src/autoapp/autoapp.cpp b/src/autoapp/autoapp.cpp index 9d33c2e..c16c84a 100644 --- a/src/autoapp/autoapp.cpp +++ b/src/autoapp/autoapp.cpp @@ -105,6 +105,7 @@ int main(int argc, char* argv[]) QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openConnectDialog, &connectDialog, &autoapp::ui::ConnectDialog::exec); if (configuration->hasTouchScreen()) { + OPENAUTO_LOG(info) << "[Touchdev] Hiding mouse cursor due to detection of a touch device"; qApplication.setOverrideCursor(Qt::BlankCursor); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::toggleCursor, [&qApplication]() { const auto cursor = qApplication.overrideCursor()->shape() == Qt::BlankCursor ? Qt::ArrowCursor : Qt::BlankCursor;