Reputation: 2505
Is there a way in QML or Qt or C++ to know if the screen (or the platform) support tactile, and more specifically, if the screen support multitouch
Is this even possible ?
EDIT :
On windows it seems we could try to enumerate the device to find one that match https://support.microsoft.com/en-us/kb/259695
This should also be possible on linux
RELATED :
What's the best way to detect a 'touch screen' device using JavaScript?
Is there a way to determine if the current screen supports touch?
Upvotes: 4
Views: 3144
Reputation: 786
In Qt6, one might check QPointingDevice::primaryPointingDevice()
and its maximumPoints()
.
Upvotes: 0
Reputation: 24406
You can use the static QTouchDevice::devices()
function to enumerate the available touch devices, and the capabilities()
function to check the capabilities of individual devices. To check for multitouch support, you would probably call maximumTouchPoints()
.
The QTouchDevice class describes the device from which touch events originate.
Each QTouchEvent contains a QTouchDevice pointer to allow accessing device-specific properties like type and capabilities. It is the responsibility of the platform or generic plug-ins to register the available touch devices via QWindowSystemInterface before generating any touch events. Applications do not need to instantiate this class, they should just access the global instances pointed to by QTouchEvent::device().
Upvotes: 6