diff options
Diffstat (limited to 'src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp')
-rw-r--r-- | src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp index b2f3fe5787..ba94bcd460 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp +++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp @@ -94,13 +94,19 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif for (const QString &device : devices) addMouse(device); - connect(m_deviceDiscovery, SIGNAL(deviceDetected(QString)), this, SLOT(addMouse(QString))); - connect(m_deviceDiscovery, SIGNAL(deviceRemoved(QString)), this, SLOT(removeMouse(QString))); + connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected, + this, &QEvdevMouseManager::addMouse); + connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved, + this, &QEvdevMouseManager::removeMouse); } } - connect(QGuiApplicationPrivate::inputDeviceManager(), SIGNAL(cursorPositionChangeRequested(QPoint)), - this, SLOT(handleCursorPositionChange(QPoint))); + QInputDeviceManager *manager = QGuiApplicationPrivate::inputDeviceManager(); + connect(manager, &QInputDeviceManager::cursorPositionChangeRequested, [=](const QPoint &pos) { + m_x = pos.x(); + m_y = pos.y(); + clampPosition(); + }); } QEvdevMouseManager::~QEvdevMouseManager() @@ -144,20 +150,21 @@ void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButto QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons, QGuiApplication::keyboardModifiers()); } -void QEvdevMouseManager::handleWheelEvent(int delta, Qt::Orientation orientation) +void QEvdevMouseManager::handleWheelEvent(QPoint delta) { QPoint pos(m_x + m_xoffset, m_y + m_yoffset); - QWindowSystemInterface::handleWheelEvent(0, pos, pos, delta, orientation, QGuiApplication::keyboardModifiers()); + QWindowSystemInterface::handleWheelEvent(0, pos, pos, QPoint(), delta, QGuiApplication::keyboardModifiers()); } void QEvdevMouseManager::addMouse(const QString &deviceNode) { qCDebug(qLcEvdevMouse) << "Adding mouse at" << deviceNode; - QEvdevMouseHandler *handler; - handler = QEvdevMouseHandler::create(deviceNode, m_spec); + QEvdevMouseHandler *handler = QEvdevMouseHandler::create(deviceNode, m_spec); if (handler) { - connect(handler, SIGNAL(handleMouseEvent(int,int,bool,Qt::MouseButtons)), this, SLOT(handleMouseEvent(int,int,bool,Qt::MouseButtons))); - connect(handler, SIGNAL(handleWheelEvent(int,Qt::Orientation)), this, SLOT(handleWheelEvent(int,Qt::Orientation))); + connect(handler, &QEvdevMouseHandler::handleMouseEvent, + this, &QEvdevMouseManager::handleMouseEvent); + connect(handler, &QEvdevMouseHandler::handleWheelEvent, + this, &QEvdevMouseManager::handleWheelEvent); m_mice.insert(deviceNode, handler); QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount( QInputDeviceManager::DeviceTypePointer, m_mice.count()); @@ -178,11 +185,4 @@ void QEvdevMouseManager::removeMouse(const QString &deviceNode) } } -void QEvdevMouseManager::handleCursorPositionChange(const QPoint &pos) -{ - m_x = pos.x(); - m_y = pos.y(); - clampPosition(); -} - QT_END_NAMESPACE |