[code] more debugging for touchscreen detection
This commit is contained in:
parent
099f14d3de
commit
eed0c9b35b
@ -160,8 +160,16 @@ void Configuration::save()
|
|||||||
bool Configuration::hasTouchScreen() const
|
bool Configuration::hasTouchScreen() const
|
||||||
{
|
{
|
||||||
auto touchdevs = QTouchDevice::devices();
|
auto touchdevs = QTouchDevice::devices();
|
||||||
|
|
||||||
|
OPENAUTO_LOG(info) << "[Touchdev] " <<
|
||||||
|
"Querying available touch devices [" <<
|
||||||
|
touchdevs.length() << " available]";
|
||||||
|
|
||||||
for (int i = 0; i < touchdevs.length(); i++) {
|
for (int i = 0; i < touchdevs.length(); i++) {
|
||||||
if (touchdevs[i]->type() == QTouchDevice::TouchScreen) {
|
if (touchdevs[i]->type() == QTouchDevice::TouchScreen) {
|
||||||
|
OPENAUTO_LOG(info) << "[Touchdev] Device " << i <<
|
||||||
|
": " << touchdevs[i]->name().toStdString() <<
|
||||||
|
", type " << touchdevs[i]->type();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ int main(int argc, char* argv[])
|
|||||||
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openConnectDialog, &connectDialog, &autoapp::ui::ConnectDialog::exec);
|
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openConnectDialog, &connectDialog, &autoapp::ui::ConnectDialog::exec);
|
||||||
|
|
||||||
if (configuration->hasTouchScreen()) {
|
if (configuration->hasTouchScreen()) {
|
||||||
|
OPENAUTO_LOG(info) << "[Touchdev] Hiding mouse cursor due to detection of a touch device";
|
||||||
qApplication.setOverrideCursor(Qt::BlankCursor);
|
qApplication.setOverrideCursor(Qt::BlankCursor);
|
||||||
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::toggleCursor, [&qApplication]() {
|
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::toggleCursor, [&qApplication]() {
|
||||||
const auto cursor = qApplication.overrideCursor()->shape() == Qt::BlankCursor ? Qt::ArrowCursor : Qt::BlankCursor;
|
const auto cursor = qApplication.overrideCursor()->shape() == Qt::BlankCursor ? Qt::ArrowCursor : Qt::BlankCursor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user