diff options
Diffstat (limited to 'src/platformsupport/input/evdevtablet')
-rw-r--r-- | src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp | 12 | ||||
-rw-r--r-- | src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp b/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp index da4b6e5172..eedde9a96e 100644 --- a/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp +++ b/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp @@ -109,8 +109,7 @@ void QEvdevTabletManager::addDevice(const QString &deviceNode) handler = new QEvdevTabletHandlerThread(deviceNode, m_spec); if (handler) { m_activeDevices.insert(deviceNode, handler); - QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount( - QInputDeviceManager::DeviceTypeTablet, m_activeDevices.count()); + updateDeviceCount(); } else { qWarning("evdevtablet: Failed to open tablet device %ls", qUtf16Printable(deviceNode)); } @@ -122,10 +121,15 @@ void QEvdevTabletManager::removeDevice(const QString &deviceNode) qCDebug(qLcEvdevTablet, "Removing device at %ls", qUtf16Printable(deviceNode)); QEvdevTabletHandlerThread *handler = m_activeDevices.value(deviceNode); m_activeDevices.remove(deviceNode); - QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount( - QInputDeviceManager::DeviceTypeTablet, m_activeDevices.count()); + updateDeviceCount(); delete handler; } } +void QEvdevTabletManager::updateDeviceCount() +{ + QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount( + QInputDeviceManager::DeviceTypeTablet, m_activeDevices.count()); +} + QT_END_NAMESPACE diff --git a/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h b/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h index b598156e52..5178e167b0 100644 --- a/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h +++ b/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h @@ -70,6 +70,8 @@ public: void removeDevice(const QString &deviceNode); private: + void updateDeviceCount(); + QString m_spec; QDeviceDiscovery *m_deviceDiscovery; QHash<QString, QEvdevTabletHandlerThread *> m_activeDevices; |