| 168 | } |
| 169 | |
| 170 | void RemoteViewServer::sendTouchEvent(const QString &deviceName, int deviceSystemId, int type, int touchDeviceType, int deviceCaps, int touchDeviceMaxTouchPoints, int modifiers, |
| 171 | const QList<QTouchEvent::TouchPoint> &touchPoints) |
| 172 | { |
| 173 | if (!m_eventReceiver) |
| 174 | return; |
| 175 | |
| 176 | if (!m_touchDevice) { |
| 177 | // create our own touch device, the system may not have one already, or it may not have |
| 178 | // the properties we want |
| 179 | |
| 180 | m_touchDevice.reset(new QPointingDevice(deviceName, deviceSystemId, |
| 181 | QPointingDevice::DeviceType(touchDeviceType), QPointingDevice::PointerType::Generic, QPointingDevice::Capabilities(deviceCaps), |
| 182 | touchDeviceMaxTouchPoints, 1)); |
| 183 | } |
| 184 | |
| 185 | QTouchEvent event(QEvent::Type(type), m_touchDevice.get(), Qt::KeyboardModifiers(modifiers), touchPoints); |
| 186 | |
| 187 | #if (QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)) |
| 188 | QMutableTouchEvent::setTarget(&event, m_eventReceiver); |
| 189 | #else |
| 190 | auto *mut = QMutableTouchEvent::from(&event); |
| 191 | mut->setTarget(m_eventReceiver); |
| 192 | #endif |
| 193 | |
| 194 | QCoreApplication::sendEvent(m_eventReceiver, &event); |
| 195 | } |
| 196 | |
| 197 | void RemoteViewServer::setViewActive(bool active) |
| 198 | { |