sensor
type string to sensorType
backLidClosed
Qt 6 is a result of the conscious effort to make the framework more efficient and easy to use.
We try to maintain binary and source compatibility for all the public APIs in each release. But some changes were inevitable in an effort to make Qt a better framework.
In this topic we summarize those changes in Qt Sensors, and provide guidance to handle them.
The Gesture support has been removed. In its current shape the gestures needs rethinking to be of more use for the developers. To track this please see QTBUG-95649.
On Windows, sensors are supported in Qt installations that were built with MSVC.
The sensorfw does not yet have a Qt 6 port and is therefore not yet supported by sensors in Qt 6.
Support for TI Sensor Tag has been removed.
QAltimeter, QDistanceSensor, QHolsterSensor and their QML counterparts did no longer have a backend implementation and have been removed.
QIRProximitySensor, QLidSensor, and QTapSensor have only sensorfw backend, and as such they are not currently listed as supported sensor types.
The Linux sysfs accelerometer support has been removed. The backend is undocumented and has been without any real activity for almost 10 years.
The typedef for the historical, QtMobility-era, qtimestamp
has been removed. Use the actual type quint64
directly.
sensor
type string to sensorType
The subclasses of QSensor implement a char const*
string which defines the string that identifies the base sensor. This static type
field shadowed the baseclass
QSensor::type() method, leading to unnecessary compilation errors and consequent workarounds. The type
string has been now renamed as sensorType
.
backLidClosed
The property name is now aligned with the frontLidClosed
property of the same QML type.
the busy state
The QSensor::busy
property and its accessor, QSensor::isBusy()
, can be used to check if the sensor is busy or not. To allow this property to better reflect the sensor backend's state, QSensorBackend::sensorBusy() now accepts a boolean parameter. This busy
parameter is used to set/unset the backend busy state and notify the QSensor interface attached to it.
The default value for the QSensorBackend::sensorBusy() parameter is true which results in the original behavior (except the added signal emission). This means that in most if not all cases the changes are not mandatory. Instead it is up to the individual sensor backend implementations to decide if the changes are useful.
The type
property cannot change after instantiation and is marked as constant in both C++ and QML.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: