MCPcopy Create free account
hub / github.com/KDAB/GammaRay / sendTouchEvent

Method sendTouchEvent

core/remoteviewserver.cpp:170–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void 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
197void RemoteViewServer::setViewActive(bool active)
198{

Callers

nothing calls this directly

Calls 4

setTargetMethod · 0.80
TypeEnum · 0.70
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected