There is a Qt Sensors library in Qt5 and Qt6. Have you looked at the Overview to see if that might provide some classes to help?