Skip to content

Commit

Permalink
manage change from qt6 in simultated sensor plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Oct 12, 2024
1 parent f934de3 commit e2c8973
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions simulator/simulatedsensorplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@

void SimulatedSensorPlugin::registerSensors()
{
#if QT_VERSION < 0x060000 //QT_VERSION_CHECK(6, 0, 0)
if (!QSensorManager::isBackendRegistered(QCompass::type, SimulatedCompass::id)) {
qInfo("Register sensor backend: %s", SimulatedCompass::id);
QSensorManager::registerBackend(QCompass::type, SimulatedCompass::id, this);
}
#else
if (!QSensorManager::isBackendRegistered(QCompass::sensorType, SimulatedCompass::id)) {
qInfo("Register sensor backend: %s", SimulatedCompass::id);
QSensorManager::registerBackend(QCompass::sensorType, SimulatedCompass::id, this);
}
#endif
}

SimulatedCompass *SimulatedSensorPlugin::createBackend(QSensor *sensor)
Expand Down

0 comments on commit e2c8973

Please sign in to comment.