Hi,
I don't think the 'signal' in the wrapper class is needed, a simple function should work fine:
Code:
Item {
id: sensor
property real rx
property real ry
property real rz
function rotationChanged (real x, real y, real z) {
rx = x
ry = y
rz = z
}
RotationSensor {
id: rsensor
active: true
onReadingChanged: {
sensor.rotationChanged(reading.x, reading.y, reading.z)
}
}
}
There seems to be very little documentation available on the qml sensor api, but i would expect the following to work fine as well:
Code:
Item {
id: sensor
property real rx: rsensor.x
property real ry: rsensor.y
property real rz: rsensor.z
RotationSensor {
id: rsensor
active: true
}
}
As for the ambient light sensor, the following is currently in the QtMobility 1.2 master tree header file for the ambient sensor:
Code:
Q_PROPERTY(LightLevel lightLevel READ lightLevel)
DECLARE_READING(QAmbientLightReading)
public:
enum LightLevel {
Undefined = 0,
Dark,
Twilight,
Light,
Bright,
Sunny
};
If i read this correctly, then the following should work:
Code:
Item {
id: sensor
property int level: rsensor.lightLevel
AmbientLightSensor {
id: rsensor
active: true
}
}
Note that i haven't tested any of this... (yet ;-)
Regards,
Mark.