AnsweredAssumed Answered

Qt Gestures (Sensors) not working on iOS?

Question asked by paul.haakma on Apr 18, 2018
Latest reply on Apr 24, 2018 by paul.haakma

I'm wondering if anyone else can confirm this or not?

 

I wanted to try the Gestures in QML out. I used just the basic code as per online examples, e.g:

 

Qt Sensors - SensorGesture QML Type example | Qt Sensors 5.10 

 

I was able to get it to work on Android, but not on my iPhone 6.

 

To check what was happening, I checked the availableGestures property of my SensorGesture object on the two devices. The android device reported a list of available gestures, but the iPhone reported none.

 

So I'm wondering if there is a reason for that, or is it some sort of bug that I should be reporting?

The very basic code would be something like this:

 

import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Dialogs 1.2
import QtSensors 5.0

MessageDialog {
id: msgDialog
}


SensorGesture {
id: sensorGesture
gestures : ["QtSensors.shake", "QtSensors.whip", "QtSensors.twist", "QtSensors.cover",
"QtSensors.hover", "QtSensors.turnover", "QtSensors.pickup", "QtSensors.slam" , "QtSensors.doubletap"]

enabled: true

}

Button{
text: "Gestures available?"
onClicked: {
msgDialog.title = 'Gestures available'
msgDialog.text = String(sensorGesture.availableGestures)
msgDialog.open()
}
}

Outcomes