From c398c3a93edfdb3e4f9aa4fda7eb1c981333dd03 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 3 Dec 2015 12:30:06 +0100 Subject: Make GenericTiltSensor::calibrate known to QMetaObject When using qml calibrating the tilt sensor does not work on WinRT and Windows Phone without this change. QmlTiltsensor::calibrate calls QTiltSensor::calibrate which calls QMetaObject::invokeMethod with "calibrate" on its backend. That causes the message "No such method QSensorBackend::calibrate()" without this change. Thus the meta system has to be made aware of that function. Change-Id: I539c0fb44e20fffb78bf515ba3767dafa3ce4ed6 Reviewed-by: Alex Blasche Reviewed-by: Maurice Kalinowski --- src/plugins/sensors/generic/generictiltsensor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/sensors/generic/generictiltsensor.h b/src/plugins/sensors/generic/generictiltsensor.h index a5a8f428..0f99f555 100644 --- a/src/plugins/sensors/generic/generictiltsensor.h +++ b/src/plugins/sensors/generic/generictiltsensor.h @@ -42,6 +42,7 @@ QT_BEGIN_NAMESPACE class GenericTiltSensor : public QSensorBackend, public QAccelerometerFilter { + Q_OBJECT public: static char const * const id; @@ -51,7 +52,7 @@ public: void start() Q_DECL_OVERRIDE; void stop() Q_DECL_OVERRIDE; - void calibrate(); + Q_INVOKABLE void calibrate(); bool filter(QAccelerometerReading *reading) Q_DECL_OVERRIDE; -- cgit v1.2.3