From 240f158d4a5d2baf28af1d8cafa8bd96a96aa75a Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Fri, 14 Jul 2023 16:07:29 +0000 Subject: [PATCH] fix build with qt6 Co-authored-by: Christophe Chapuis --- adaptors/alsadaptor/alsadaptor.cpp | 2 +- .../hybrisaccelerometer.pro | 2 +- .../hybrisalsadaptor/hybrisalsadaptor.pro | 2 +- .../hybrisgeorotationadaptor.pro | 2 +- .../hybrisgyroscopeadaptor.pro | 2 +- .../hybrismagnetometeradaptor.pro | 2 +- .../hybrisorientationadaptor.pro | 2 +- .../hybrispressureadaptor.pro | 2 +- .../hybrisproximityadaptor.pro | 2 +- .../hybrisrotationadaptor.pro | 2 +- .../hybrisstepcounteradaptor.pro | 2 +- adaptors/iioadaptor/iioadaptor.cpp | 2 +- .../accelerometerchainplugin.cpp | 4 ++++ chains/compasschain/compasschainplugin.cpp | 8 +++++++ .../magcalibrationchainplugin.cpp | 4 ++++ .../orientationchainplugin.cpp | 4 ++++ common-config.pri | 2 +- common-install.pri | 4 ++-- common.pri | 2 +- core/core.pro | 6 ++--- core/hybris.pro | 2 +- core/loader.cpp | 4 ++++ core/nodebase.cpp | 4 ++++ doc/doc.pri | 2 +- examples/chainplugin/samplechainplugin.cpp | 4 ++++ examples/filterplugin/samplefilter.h | 1 + examples/sensorplugin/sampleplugin.cpp | 4 ++++ qt-api/abstractsensor_i.cpp | 23 +++++++++---------- qt-api/abstractsensor_i.h | 4 ++++ qt-api/qt-api.pro | 2 +- qt-api/sensormanager_i.cpp | 14 +++++++++++ sensord-qt6.pc.in | 10 ++++++++ sensord.prf | 6 ++--- sensord/sensord.pro | 2 +- sensorfw.pro | 17 +++++++------- .../accelerometerplugin.cpp | 4 ++++ sensors/alssensor/alsplugin.cpp | 4 ++++ sensors/compasssensor/compassplugin.cpp | 4 ++++ sensors/contextplugin/contextplugin.cpp | 4 ++++ sensors/gyroscopesensor/gyroscopeplugin.cpp | 4 ++++ sensors/humiditysensor/humidityplugin.cpp | 4 ++++ sensors/lidsensor/lidplugin.cpp | 4 ++++ .../magnetometersensor/magnetometerplugin.cpp | 4 ++++ .../orientationsensor/orientationplugin.cpp | 4 ++++ sensors/pressuresensor/pressureplugin.cpp | 4 ++++ sensors/proximitysensor/proximityplugin.cpp | 4 ++++ sensors/rotationsensor/rotationplugin.cpp | 4 ++++ .../stepcountersensor/stepcounterplugin.cpp | 4 ++++ sensors/tapsensor/tapplugin.cpp | 4 ++++ .../temperaturesensor/temperatureplugin.cpp | 4 ++++ .../benchmark/benchmarktest/benchmarktest.pro | 2 +- tests/benchmark/benchmarktest/signaldump.h | 12 ++++++++++ tests/benchmark/dummyclient/dummyclient.pro | 2 +- tests/client/client.pro | 2 +- tests/common-install.pri | 2 +- tests/deadclient/deadclient.pro | 2 +- tests/metadata/metadata.pro | 2 +- .../driverpolltest/driverpolltest.pro | 2 +- .../powermanagementtests.pro | 2 +- .../standbyoverridetests.pro | 2 +- tests/testapp/testapp.pro | 2 +- tests/testutils/datafaker/main.cpp | 4 ++++ 62 files changed, 197 insertions(+), 56 deletions(-) create mode 100644 sensord-qt6.pc.in diff --git a/adaptors/alsadaptor/alsadaptor.cpp b/adaptors/alsadaptor/alsadaptor.cpp index f9ee790f..9647038f 100644 --- a/adaptors/alsadaptor/alsadaptor.cpp +++ b/adaptors/alsadaptor/alsadaptor.cpp @@ -200,7 +200,7 @@ void ALSAdaptor::processSample(int pathId, int fd) sensordLogW() << id() << "read(): " << strerror(errno); return; } - QVariant value(buffer); + QVariant value = QVariant::fromValue(QByteArray(buffer)); bool ok; double fValue(value.toDouble(&ok)); if(!ok) { diff --git a/adaptors/hybrisaccelerometer/hybrisaccelerometer.pro b/adaptors/hybrisaccelerometer/hybrisaccelerometer.pro index 05ec4b5a..18cf1a88 100644 --- a/adaptors/hybrisaccelerometer/hybrisaccelerometer.pro +++ b/adaptors/hybrisaccelerometer/hybrisaccelerometer.pro @@ -5,7 +5,7 @@ HEADERS += hybrisaccelerometeradaptor.h \ SOURCES += hybrisaccelerometeradaptor.cpp \ hybrisaccelerometeradaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrisalsadaptor/hybrisalsadaptor.pro b/adaptors/hybrisalsadaptor/hybrisalsadaptor.pro index fa384714..24800b9b 100644 --- a/adaptors/hybrisalsadaptor/hybrisalsadaptor.pro +++ b/adaptors/hybrisalsadaptor/hybrisalsadaptor.pro @@ -5,7 +5,7 @@ HEADERS += hybrisalsadaptor.h \ SOURCES += hybrisalsadaptor.cpp \ hybrisalsadaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptor.pro b/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptor.pro index cdff669a..a08e9e4a 100644 --- a/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptor.pro +++ b/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptor.pro @@ -6,7 +6,7 @@ HEADERS += hybrisgeorotationadaptor.h \ SOURCES += hybrisgeorotationadaptor.cpp \ hybrisgeorotationadaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.pro b/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.pro index 8c0c5237..2c6325ad 100644 --- a/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.pro +++ b/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.pro @@ -6,7 +6,7 @@ HEADERS += hybrisgyroscopeadaptor.h \ SOURCES += hybrisgyroscopeadaptor.cpp \ hybrisgyroscopeadaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptor.pro b/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptor.pro index 060e447d..55040854 100644 --- a/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptor.pro +++ b/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptor.pro @@ -6,7 +6,7 @@ HEADERS += hybrismagnetometeradaptor.h \ SOURCES += hybrismagnetometeradaptor.cpp \ hybrismagnetometeradaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrisorientationadaptor/hybrisorientationadaptor.pro b/adaptors/hybrisorientationadaptor/hybrisorientationadaptor.pro index d4d5e482..93ec675c 100644 --- a/adaptors/hybrisorientationadaptor/hybrisorientationadaptor.pro +++ b/adaptors/hybrisorientationadaptor/hybrisorientationadaptor.pro @@ -6,7 +6,7 @@ HEADERS += hybrisorientationadaptor.h \ SOURCES += hybrisorientationadaptor.cpp \ hybrisorientationadaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrispressureadaptor/hybrispressureadaptor.pro b/adaptors/hybrispressureadaptor/hybrispressureadaptor.pro index 59029ff2..03f9893b 100644 --- a/adaptors/hybrispressureadaptor/hybrispressureadaptor.pro +++ b/adaptors/hybrispressureadaptor/hybrispressureadaptor.pro @@ -5,7 +5,7 @@ HEADERS += hybrispressureadaptor.h \ SOURCES += hybrispressureadaptor.cpp \ hybrispressureadaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrisproximityadaptor/hybrisproximityadaptor.pro b/adaptors/hybrisproximityadaptor/hybrisproximityadaptor.pro index 7489ab1d..ba764988 100644 --- a/adaptors/hybrisproximityadaptor/hybrisproximityadaptor.pro +++ b/adaptors/hybrisproximityadaptor/hybrisproximityadaptor.pro @@ -6,7 +6,7 @@ HEADERS += hybrisproximityadaptor.h \ SOURCES += hybrisproximityadaptor.cpp \ hybrisproximityadaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrisrotationadaptor/hybrisrotationadaptor.pro b/adaptors/hybrisrotationadaptor/hybrisrotationadaptor.pro index b0001982..c47399b1 100644 --- a/adaptors/hybrisrotationadaptor/hybrisrotationadaptor.pro +++ b/adaptors/hybrisrotationadaptor/hybrisrotationadaptor.pro @@ -6,7 +6,7 @@ HEADERS += hybrisrotationadaptor.h \ SOURCES += hybrisrotationadaptor.cpp \ hybrisrotationadaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.pro b/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.pro index 9af199d6..2238bbad 100644 --- a/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.pro +++ b/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.pro @@ -5,7 +5,7 @@ HEADERS += hybrisstepcounteradaptor.h \ SOURCES += hybrisstepcounteradaptor.cpp \ hybrisstepcounteradaptorplugin.cpp -LIBS+= -L../../core -lhybrissensorfw-qt5 +LIBS+= -L../../core -lhybrissensorfw-qt$${QT_MAJOR_VERSION} include( ../adaptor-config.pri ) config_hybris { diff --git a/adaptors/iioadaptor/iioadaptor.cpp b/adaptors/iioadaptor/iioadaptor.cpp index 05fca559..a9cc4b53 100644 --- a/adaptors/iioadaptor/iioadaptor.cpp +++ b/adaptors/iioadaptor/iioadaptor.cpp @@ -150,7 +150,7 @@ void IioAdaptor::setup() iioDevice.channelTypeName = "proximity"; devNodeNumber = findSensor(inputMatch); - proximityThreshold = SensorFrameworkConfig::configuration()->value(name + "/threshold", QString(PROXIMITY_DEFAULT_THRESHOLD)).toInt(); + proximityThreshold = SensorFrameworkConfig::configuration()->value(name + "/threshold", QString("%1").arg(PROXIMITY_DEFAULT_THRESHOLD)).toInt(); if (devNodeNumber!= -1) { QString desc = "Industrial I/O proximity sensor (" + iioDevice.name +")"; qDebug() << id() << desc; diff --git a/chains/accelerometerchain/accelerometerchainplugin.cpp b/chains/accelerometerchain/accelerometerchainplugin.cpp index c3902b74..1af8d7f9 100644 --- a/chains/accelerometerchain/accelerometerchainplugin.cpp +++ b/chains/accelerometerchain/accelerometerchainplugin.cpp @@ -37,5 +37,9 @@ void AccelerometerChainPlugin::Register(class Loader&) } QStringList AccelerometerChainPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("coordinatealignfilter:accelerometeradaptor").split(":", Qt::SkipEmptyParts); +#else return QString("coordinatealignfilter:accelerometeradaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/chains/compasschain/compasschainplugin.cpp b/chains/compasschain/compasschainplugin.cpp index 74bcaf3f..a470a0cd 100644 --- a/chains/compasschain/compasschainplugin.cpp +++ b/chains/compasschain/compasschainplugin.cpp @@ -38,8 +38,16 @@ void CompassChainPlugin::Register(class Loader&) QStringList CompassChainPlugin::Dependencies() { QByteArray orientationConfiguration = SensorFrameworkConfig::configuration()->value("plugins/orientationadaptor").toByteArray(); if (orientationConfiguration.isEmpty()) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("accelerometerchain:magcalibrationchain:declinationfilter:downsamplefilter:avgaccfilter").split(":", Qt::SkipEmptyParts); +#else return QString("accelerometerchain:magcalibrationchain:declinationfilter:downsamplefilter:avgaccfilter").split(":", QString::SkipEmptyParts); +#endif } else { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("accelerometerchain:magcalibrationchain:declinationfilter:downsamplefilter:avgaccfilter:orientationadaptor").split(":", Qt::SkipEmptyParts); +#else return QString("accelerometerchain:magcalibrationchain:declinationfilter:downsamplefilter:avgaccfilter:orientationadaptor").split(":", QString::SkipEmptyParts); +#endif } } diff --git a/chains/magcalibrationchain/magcalibrationchainplugin.cpp b/chains/magcalibrationchain/magcalibrationchainplugin.cpp index 6712269b..cfc0d98e 100644 --- a/chains/magcalibrationchain/magcalibrationchainplugin.cpp +++ b/chains/magcalibrationchain/magcalibrationchainplugin.cpp @@ -32,5 +32,9 @@ void MagCalibrationChainPlugin::Register(class Loader&) } QStringList MagCalibrationChainPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("magcoordinatealignfilter:magnetometeradaptor").split(":", Qt::SkipEmptyParts); +#else return QString("magcoordinatealignfilter:magnetometeradaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/chains/orientationchain/orientationchainplugin.cpp b/chains/orientationchain/orientationchainplugin.cpp index 84d452d9..f494abf2 100644 --- a/chains/orientationchain/orientationchainplugin.cpp +++ b/chains/orientationchain/orientationchainplugin.cpp @@ -37,5 +37,9 @@ void OrientationChainPlugin::Register(class Loader&) } QStringList OrientationChainPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("orientationinterpreter:accelerometerchain").split(":", Qt::SkipEmptyParts); +#else return QString("orientationinterpreter:accelerometerchain").split(":", QString::SkipEmptyParts); +#endif } diff --git a/common-config.pri b/common-config.pri index ce5f7254..1ac908b5 100644 --- a/common-config.pri +++ b/common-config.pri @@ -29,7 +29,7 @@ profile-libc { QMAKE_LFLAGS += -lc_p } -TARGET = $$TARGET-qt5 +TARGET = $$TARGET-qt$${QT_MAJOR_VERSION} OTHER_FILES += \ ../../common.pri diff --git a/common-install.pri b/common-install.pri index 906f5b98..bc1b2aec 100644 --- a/common-install.pri +++ b/common-install.pri @@ -8,8 +8,8 @@ QT -= gui # Path for headers - remember to add files if they should be installed -publicheaders.path = /usr/include/sensord-qt5 -PLUGINPATH = $$[QT_INSTALL_LIBS]/sensord-qt5 +publicheaders.path = /usr/include/sensord-qt$${QT_MAJOR_VERSION} +PLUGINPATH = $$[QT_INSTALL_LIBS]/sensord-qt$${QT_MAJOR_VERSION} # Path for shared libraries SHAREDLIBPATH = $$[QT_INSTALL_LIBS] diff --git a/common.pri b/common.pri index c0dfebf3..d228c9e3 100644 --- a/common.pri +++ b/common.pri @@ -1 +1 @@ -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorfw-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorfw-qt$${QT_MAJOR_VERSION} diff --git a/core/core.pro b/core/core.pro index e98258aa..5239e36c 100644 --- a/core/core.pro +++ b/core/core.pro @@ -15,10 +15,10 @@ SENSORFW_INCLUDEPATHS = .. \ DEPENDPATH += $$SENSORFW_INCLUDEPATHS INCLUDEPATH += $$SENSORFW_INCLUDEPATHS -DEFINES += PLUGIN_DIRECTORY=\"\\\"$$[QT_INSTALL_LIBS]/sensord-qt5\\\"\" +DEFINES += PLUGIN_DIRECTORY=\"\\\"$$[QT_INSTALL_LIBS]/sensord-qt$${QT_MAJOR_VERSION}\\\"\" QMAKE_LIBDIR_FLAGS += -L../datatypes\ - -lsensordatatypes-qt5 + -lsensordatatypes-qt$${QT_MAJOR_VERSION} SOURCES += sensormanager.cpp \ sensormanager_a.cpp \ @@ -85,7 +85,7 @@ lunaservice { SOURCES += lsclient.cpp HEADERS += lsclient.h DEFINES += SENSORFW_LUNA_SERVICE_CLIENT - PKGCONFIG += Qt5Gui json-c + PKGCONFIG += Qt$${QT_MAJOR_VERSION}Gui json-c PKGCONFIG += luna-service2 LunaSysMgrCommon LunaSysMgrIpcMessages } diff --git a/core/hybris.pro b/core/hybris.pro index 4567bb00..a9c87dc4 100644 --- a/core/hybris.pro +++ b/core/hybris.pro @@ -15,7 +15,7 @@ INCLUDEPATH += $$SENSORFW_INCLUDEPATHS SOURCES += hybrisadaptor.cpp HEADERS += hybrisadaptor.h -LIBS += -L$$[QT_INSTALL_LIBS] -L../datatypes -lsensordatatypes-qt5 -L. -lsensorfw-qt5 +LIBS += -L$$[QT_INSTALL_LIBS] -L../datatypes -lsensordatatypes-qt$${QT_MAJOR_VERSION} -L. -lsensorfw-qt$${QT_MAJOR_VERSION} CONFIG += link_pkgconfig diff --git a/core/loader.cpp b/core/loader.cpp index aae6055f..e8b2e1b8 100644 --- a/core/loader.cpp +++ b/core/loader.cpp @@ -55,7 +55,11 @@ Loader& Loader::instance() #define PLUGIN_PREFIX_ENV "SENSORFW_LIBRARY_PATH" #define PLUGIN_PREFIX "lib" +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#define PLUGIN_SUFFIX "-qt6.so" +#else #define PLUGIN_SUFFIX "-qt5.so" +#endif #define SENSOR_SUFFIX "sensor" static QString getPluginDirectory() diff --git a/core/nodebase.cpp b/core/nodebase.cpp index c7761022..c2be1723 100644 --- a/core/nodebase.cpp +++ b/core/nodebase.cpp @@ -228,7 +228,11 @@ bool NodeBase::hasLocalRange() const DataRangeList NodeBase::parseDataRangeList(const QString& input, int defaultResolution) const { DataRangeList list; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + foreach(const QString& fragment, input.split(",", Qt::SkipEmptyParts)) +#else foreach(const QString& fragment, input.split(",", QString::SkipEmptyParts)) +#endif { QStringList pair(fragment.split("=>")); QStringList pair2(fragment.split(":")); diff --git a/doc/doc.pri b/doc/doc.pri index 63180bef..86cbae4a 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -33,7 +33,7 @@ for( folder, DOC_FOLDERS ) { QMAKE_EXTRA_TARGETS += doccleantarget # Documentation install target -documentation.path = /usr/share/doc/sensord-qt5 +documentation.path = /usr/share/doc/sensord-qt$${QT_MAJOR_VERSION} documentation.files = doc/html documentation.depends = docs diff --git a/examples/chainplugin/samplechainplugin.cpp b/examples/chainplugin/samplechainplugin.cpp index 1e4508f9..9cf1f300 100644 --- a/examples/chainplugin/samplechainplugin.cpp +++ b/examples/chainplugin/samplechainplugin.cpp @@ -41,5 +41,9 @@ void SampleChainPlugin::Register(class Loader&) // // Here we have one adaptor and one filter that we need. QStringList SampleChainPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("sampleadaptor:samplefilter").split(":", Qt::SkipEmptyParts); +#else return QString("sampleadaptor:samplefilter").split(":", QString::SkipEmptyParts); +#endif } diff --git a/examples/filterplugin/samplefilter.h b/examples/filterplugin/samplefilter.h index 43e50169..3720dfa1 100644 --- a/examples/filterplugin/samplefilter.h +++ b/examples/filterplugin/samplefilter.h @@ -27,6 +27,7 @@ #ifndef SAMPLEFILTER_H #define SAMPLEFILTER_H +#include // Include base #include "filter.h" diff --git a/examples/sensorplugin/sampleplugin.cpp b/examples/sensorplugin/sampleplugin.cpp index ec326cee..3fd917d5 100644 --- a/examples/sensorplugin/sampleplugin.cpp +++ b/examples/sensorplugin/sampleplugin.cpp @@ -40,5 +40,9 @@ void SamplePlugin::Register(class Loader&) // dependency here. We can rely on it to provide further dependencies to // any plugins it may need. QStringList SamplePlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("samplechain").split(":", Qt::SkipEmptyParts); +#else return QString("samplechain").split(":", QString::SkipEmptyParts); +#endif } diff --git a/qt-api/abstractsensor_i.cpp b/qt-api/abstractsensor_i.cpp index 3e27ed3e..946bd323 100644 --- a/qt-api/abstractsensor_i.cpp +++ b/qt-api/abstractsensor_i.cpp @@ -139,7 +139,7 @@ QDBusReply AbstractSensorChannelInterface::start(int sessionId) connect(pimpl_->m_socketReader.socket(), SIGNAL(readyRead()), this, SLOT(dataReceived())); QList argumentList; - argumentList << qVariantFromValue(sessionId); + argumentList << QVariant::fromValue(sessionId); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("start"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); @@ -177,8 +177,7 @@ QDBusReply AbstractSensorChannelInterface::stop(int sessionId) disconnect(pimpl_->m_socketReader.socket(), SIGNAL(readyRead()), this, SLOT(dataReceived())); QList argumentList; - argumentList << qVariantFromValue(sessionId); - + argumentList << QVariant::fromValue(sessionId); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("stop"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -202,7 +201,7 @@ QDBusReply AbstractSensorChannelInterface::setInterval(int sessionId, int clearError(); QList argumentList; - argumentList << qVariantFromValue(sessionId) << qVariantFromValue(interval_ms); + argumentList << QVariant::fromValue(sessionId) << QVariant::fromValue(interval_ms); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("setInterval"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -226,7 +225,7 @@ QDBusReply AbstractSensorChannelInterface::setDataRate(int sessionId, doub clearError(); QList argumentList; - argumentList << qVariantFromValue(sessionId) << qVariantFromValue(dataRate_Hz); + argumentList << QVariant::fromValue(sessionId) << QVariant::fromValue(dataRate_Hz); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("setDataRate"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -250,7 +249,7 @@ QDBusReply AbstractSensorChannelInterface::setBufferInterval(int sessionId clearError(); QList argumentList; - argumentList << qVariantFromValue(sessionId) << qVariantFromValue(interval_ms); + argumentList << QVariant::fromValue(sessionId) << QVariant::fromValue(interval_ms); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("setBufferInterval"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -275,7 +274,7 @@ QDBusReply AbstractSensorChannelInterface::setBufferSize(int sessionId, un clearError(); QList argumentList; - argumentList << qVariantFromValue(sessionId) << qVariantFromValue(value); + argumentList << QVariant::fromValue(sessionId) << QVariant::fromValue(value); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("setBufferSize"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); @@ -300,7 +299,7 @@ QDBusReply AbstractSensorChannelInterface::setStandbyOverride(int sessionI clearError(); QList argumentList; - argumentList << qVariantFromValue(sessionId) << qVariantFromValue(value); + argumentList << QVariant::fromValue(sessionId) << QVariant::fromValue(value); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("setStandbyOverride"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -332,13 +331,13 @@ DataRange AbstractSensorChannelInterface::getCurrentDataRange() void AbstractSensorChannelInterface::requestDataRange(DataRange range) { clearError(); - call(QDBus::NoBlock, QLatin1String("requestDataRange"), qVariantFromValue(pimpl_->m_sessionId), qVariantFromValue(range)); + call(QDBus::NoBlock, QLatin1String("requestDataRange"), QVariant::fromValue(pimpl_->m_sessionId), QVariant::fromValue(range)); } void AbstractSensorChannelInterface::removeDataRangeRequest() { clearError(); - call(QDBus::NoBlock, QLatin1String("removeDataRangeRequest"), qVariantFromValue(pimpl_->m_sessionId)); + call(QDBus::NoBlock, QLatin1String("removeDataRangeRequest"), QVariant::fromValue(pimpl_->m_sessionId)); } DataRangeList AbstractSensorChannelInterface::getAvailableIntervals() @@ -499,7 +498,7 @@ bool AbstractSensorChannelInterface::setDataRangeIndex(int dataRangeIndex) { clearError(); QList argumentList; - argumentList << qVariantFromValue(pimpl_->m_sessionId) << qVariantFromValue(dataRangeIndex); + argumentList << QVariant::fromValue(pimpl_->m_sessionId) << QVariant::fromValue(dataRangeIndex); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("setDataRangeIndex"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); @@ -564,7 +563,7 @@ QDBusReply AbstractSensorChannelInterface::setDownsampling(int sessionId, clearError(); QList argumentList; - argumentList << qVariantFromValue(sessionId) << qVariantFromValue(value); + argumentList << QVariant::fromValue(sessionId) << QVariant::fromValue(value); QDBusPendingReply returnValue = pimpl_->asyncCallWithArgumentList(QLatin1String("setDownsampling"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(returnValue, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), diff --git a/qt-api/abstractsensor_i.h b/qt-api/abstractsensor_i.h index 0bd6fa3a..311aecf1 100644 --- a/qt-api/abstractsensor_i.h +++ b/qt-api/abstractsensor_i.h @@ -527,7 +527,11 @@ T AbstractSensorChannelInterface::getAccessor(const char* name) template void AbstractSensorChannelInterface::setAccessor(const char* name, const T& value) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QDBusReply reply(call(QDBus::NoBlock, QLatin1String(name), QVariant::fromValue(value))); +#else QDBusReply reply(call(QDBus::NoBlock, QLatin1String(name), qVariantFromValue(value))); +#endif if(!reply.isValid()) { qDebug() << "Failed to set '" << name << " = " << value << "' to sensord: " << reply.error().message(); diff --git a/qt-api/qt-api.pro b/qt-api/qt-api.pro index 1fa3d7db..c3ee297f 100644 --- a/qt-api/qt-api.pro +++ b/qt-api/qt-api.pro @@ -51,7 +51,7 @@ SENSORFW_INCLUDEPATHS = .. \ DEPENDPATH += $$SENSORFW_INCLUDEPATHS INCLUDEPATH += $$SENSORFW_INCLUDEPATHS -QMAKE_LIBDIR_FLAGS += -L../datatypes -lsensordatatypes-qt5 +QMAKE_LIBDIR_FLAGS += -L../datatypes -lsensordatatypes-qt$${QT_MAJOR_VERSION} include(../common-install.pri) publicheaders.files = $$HEADERS diff --git a/qt-api/sensormanager_i.cpp b/qt-api/sensormanager_i.cpp index 0f27accf..70da911f 100644 --- a/qt-api/sensormanager_i.cpp +++ b/qt-api/sensormanager_i.cpp @@ -71,7 +71,11 @@ int LocalSensorManagerInterface::errorCodeInt() QDBusReply LocalSensorManagerInterface::loadPlugin(const QString& name) { QList argumentList; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + argumentList << QVariant::fromValue(name); +#else argumentList << qVariantFromValue(name); +#endif QDBusPendingReply reply = asyncCallWithArgumentList(QLatin1String("loadPlugin"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -96,8 +100,13 @@ QDBusReply LocalSensorManagerInterface::requestSensor(const QString& id) { qint64 pid = QCoreApplication::applicationPid(); QList argumentList; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + argumentList << QVariant::fromValue(id); + argumentList << QVariant::fromValue(pid); +#else argumentList << qVariantFromValue(id); argumentList << qVariantFromValue(pid); +#endif QDBusPendingReply reply = asyncCallWithArgumentList(QLatin1String("requestSensor"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -121,8 +130,13 @@ QDBusReply LocalSensorManagerInterface::releaseSensor(const QString& id, i { qint64 pid = QCoreApplication::applicationPid(); QList argumentList; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + argumentList << QVariant::fromValue(id) << QVariant::fromValue(sessionId); + argumentList << QVariant::fromValue(pid); +#else argumentList << qVariantFromValue(id) << qVariantFromValue(sessionId); argumentList << qVariantFromValue(pid); +#endif QDBusPendingReply reply = asyncCallWithArgumentList(QLatin1String("releaseSensor"), argumentList); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), diff --git a/sensord-qt6.pc.in b/sensord-qt6.pc.in new file mode 100644 index 00000000..8e0f6fd0 --- /dev/null +++ b/sensord-qt6.pc.in @@ -0,0 +1,10 @@ +prefix=/usr +includedir=${prefix}/include/sensord-qt6 +libdir=${prefix}/@LIB@ + +Name: Sensorfw-qt6 +Description: Sensord for Qt 6 +Version: 0.14.4 +Requires: +Libs: -L${libdir} -lsensorclient-qt6 -lsensordatatypes-qt6 +Cflags: -I${includedir} -I${includedir}/datatypes diff --git a/sensord.prf b/sensord.prf index cb553986..44264470 100644 --- a/sensord.prf +++ b/sensord.prf @@ -1,5 +1,5 @@ -LIBS += -L$$[QT_INSTALL_LIBS] -lsensorclient-qt5 -lsensordatatypes-qt5 -DEPENDPATH += /usr/include/sensord-qt5 -INCLUDEPATH += /usr/include/sensord-qt5 /usr/include/sensord-qt5/datatypes /usr/include/sensord-qt5/filters +LIBS += -L$$[QT_INSTALL_LIBS] -lsensorclient-qt$${QT_MAJOR_VERSION} -lsensordatatypes-qt$${QT_MAJOR_VERSION} +DEPENDPATH += /usr/include/sensord-qt$${QT_MAJOR_VERSION} +INCLUDEPATH += /usr/include/sensord-qt$${QT_MAJOR_VERSION} /usr/include/sensord-qt$${QT_MAJOR_VERSION}/datatypes /usr/include/sensord-qt$${QT_MAJOR_VERSION}/filters diff --git a/sensord/sensord.pro b/sensord/sensord.pro index 3fd453d7..8bb22f41 100644 --- a/sensord/sensord.pro +++ b/sensord/sensord.pro @@ -23,7 +23,7 @@ INCLUDEPATH += $$SENSORFW_INCLUDEPATHS QMAKE_LIBDIR_FLAGS += -L../datatypes \ -L../core -TARGET_H.path += /usr/include/sensord-qt5 +TARGET_H.path += /usr/include/sensord-qt$${QT_MAJOR_VERSION} SOURCES += main.cpp \ parser.cpp \ diff --git a/sensorfw.pro b/sensorfw.pro index c8ce4919..462624fa 100644 --- a/sensorfw.pro +++ b/sensorfw.pro @@ -80,15 +80,16 @@ contains(CONFIG,hybris) { include( common-install.pri ) include( common-config.pri ) - PKGCONFIGFILES.files = sensord-qt5.pc - PKGCONFIGFILES.commands = 'sed -i "s/Version:.*/Version: $$PC_VERSION/" $$_PRO_FILE_PWD_/sensord-qt5.pc' - QTCONFIGFILES.path = /usr/share/qt5/mkspecs/features + PKGCONFIGFILES.files = sensord-qt$${QT_MAJOR_VERSION}.pc + PKGCONFIGFILES.commands = 'sed -i "s/Version:.*/Version: $$PC_VERSION/" $$_PRO_FILE_PWD_/sensord-qt$${QT_MAJOR_VERSION}.pc' + QTCONFIGFILES.path = $$[QT_INSTALL_ARCHDATA]/mkspecs/features + } # How to make this work in all cases? -#PKGCONFIGFILES.commands = sed -i \"s/Version:.*$$/Version: `head -n1 debian/changelog | cut -f 2 -d\' \' | tr -d \'()\'`/\" sensord-qt5.pc +#PKGCONFIGFILES.commands = sed -i \"s/Version:.*$$/Version: `head -n1 debian/changelog | cut -f 2 -d\' \' | tr -d \'()\'`/\" sensord-qt$${QT_MAJOR_VERSION}.pc !contains(CONFIG,hybris) { @@ -111,9 +112,9 @@ contains(CONFIG,systemdunit) { INSTALLS += SENSORSYSTEMD } -OTHER_FILES += rpm/sensorfw-qt5.spec \ - rpm/sensorfw-qt5-binder.spec \ - rpm/sensorfw-qt5-hybris.inc \ - rpm/sensorfw-qt5-hybris.spec +OTHER_FILES += rpm/sensorfw-qt$${QT_MAJOR_VERSION}.spec \ + rpm/sensorfw-qt$${QT_MAJOR_VERSION}-binder.spec \ + rpm/sensorfw-qt$${QT_MAJOR_VERSION}-hybris.inc \ + rpm/sensorfw-qt$${QT_MAJOR_VERSION}-hybris.spec OTHER_FILES += config/* diff --git a/sensors/accelerometersensor/accelerometerplugin.cpp b/sensors/accelerometersensor/accelerometerplugin.cpp index 70029fb2..ce894f24 100644 --- a/sensors/accelerometersensor/accelerometerplugin.cpp +++ b/sensors/accelerometersensor/accelerometerplugin.cpp @@ -37,5 +37,9 @@ void AccelerometerPlugin::Register(class Loader&) } QStringList AccelerometerPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("accelerometerchain").split(":", Qt::SkipEmptyParts); +#else return QString("accelerometerchain").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/alssensor/alsplugin.cpp b/sensors/alssensor/alsplugin.cpp index 23b56378..44f2d687 100644 --- a/sensors/alssensor/alsplugin.cpp +++ b/sensors/alssensor/alsplugin.cpp @@ -43,5 +43,9 @@ void ALSPlugin::Init(class Loader& l) } QStringList ALSPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("alsadaptor").split(":", Qt::SkipEmptyParts); +#else return QString("alsadaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/compasssensor/compassplugin.cpp b/sensors/compasssensor/compassplugin.cpp index c9b088d7..926d88e1 100644 --- a/sensors/compasssensor/compassplugin.cpp +++ b/sensors/compasssensor/compassplugin.cpp @@ -37,5 +37,9 @@ void CompassPlugin::Register(class Loader&) } QStringList CompassPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("compasschain").split(":", Qt::SkipEmptyParts); +#else return QString("compasschain").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/contextplugin/contextplugin.cpp b/sensors/contextplugin/contextplugin.cpp index 3ab5e74c..58e76031 100644 --- a/sensors/contextplugin/contextplugin.cpp +++ b/sensors/contextplugin/contextplugin.cpp @@ -43,7 +43,11 @@ void ContextPlugin::Init(class Loader&) } QStringList ContextPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("accelerometeradaptor:orientationchain").split(":", Qt::SkipEmptyParts); +#else return QString("accelerometeradaptor:orientationchain").split(":", QString::SkipEmptyParts); +#endif } int ContextPlugin::getSessionId() diff --git a/sensors/gyroscopesensor/gyroscopeplugin.cpp b/sensors/gyroscopesensor/gyroscopeplugin.cpp index e28ef513..95e0c48e 100644 --- a/sensors/gyroscopesensor/gyroscopeplugin.cpp +++ b/sensors/gyroscopesensor/gyroscopeplugin.cpp @@ -37,5 +37,9 @@ void GyroscopePlugin::Register(class Loader&) } QStringList GyroscopePlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("gyroscopeadaptor").split(":", Qt::SkipEmptyParts); +#else return QString("gyroscopeadaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/humiditysensor/humidityplugin.cpp b/sensors/humiditysensor/humidityplugin.cpp index fd0d03d7..ba173d15 100644 --- a/sensors/humiditysensor/humidityplugin.cpp +++ b/sensors/humiditysensor/humidityplugin.cpp @@ -42,5 +42,9 @@ void HumidityPlugin::Init(class Loader& l) } QStringList HumidityPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("humidityadaptor").split(":", Qt::SkipEmptyParts); +#else return QString("humidityadaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/lidsensor/lidplugin.cpp b/sensors/lidsensor/lidplugin.cpp index 85964c83..6007d667 100644 --- a/sensors/lidsensor/lidplugin.cpp +++ b/sensors/lidsensor/lidplugin.cpp @@ -42,5 +42,9 @@ void LidPlugin::Init(class Loader& l) } QStringList LidPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("lidsensoradaptor").split(":", Qt::SkipEmptyParts); +#else return QString("lidsensoradaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/magnetometersensor/magnetometerplugin.cpp b/sensors/magnetometersensor/magnetometerplugin.cpp index ee579214..7f3a7b60 100644 --- a/sensors/magnetometersensor/magnetometerplugin.cpp +++ b/sensors/magnetometersensor/magnetometerplugin.cpp @@ -37,5 +37,9 @@ void MagnetometerPlugin::Register(class Loader&) } QStringList MagnetometerPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("magcalibrationchain").split(":", Qt::SkipEmptyParts); +#else return QString("magcalibrationchain").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/orientationsensor/orientationplugin.cpp b/sensors/orientationsensor/orientationplugin.cpp index 3eb32b25..226b51e3 100644 --- a/sensors/orientationsensor/orientationplugin.cpp +++ b/sensors/orientationsensor/orientationplugin.cpp @@ -37,5 +37,9 @@ void OrientationPlugin::Register(class Loader&) } QStringList OrientationPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("orientationchain").split(":", Qt::SkipEmptyParts); +#else return QString("orientationchain").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/pressuresensor/pressureplugin.cpp b/sensors/pressuresensor/pressureplugin.cpp index 50fe101a..bda6d5a2 100644 --- a/sensors/pressuresensor/pressureplugin.cpp +++ b/sensors/pressuresensor/pressureplugin.cpp @@ -42,5 +42,9 @@ void PressurePlugin::Init(class Loader& l) } QStringList PressurePlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("pressureadaptor").split(":", Qt::SkipEmptyParts); +#else return QString("pressureadaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/proximitysensor/proximityplugin.cpp b/sensors/proximitysensor/proximityplugin.cpp index b2f207a2..357c0e07 100644 --- a/sensors/proximitysensor/proximityplugin.cpp +++ b/sensors/proximitysensor/proximityplugin.cpp @@ -36,5 +36,9 @@ void ProximityPlugin::Register(class Loader&) } QStringList ProximityPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("proximityadaptor").split(":", Qt::SkipEmptyParts); +#else return QString("proximityadaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/rotationsensor/rotationplugin.cpp b/sensors/rotationsensor/rotationplugin.cpp index e6ece7a2..8cd19428 100644 --- a/sensors/rotationsensor/rotationplugin.cpp +++ b/sensors/rotationsensor/rotationplugin.cpp @@ -36,5 +36,9 @@ void RotationPlugin::Register(class Loader&) } QStringList RotationPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("accelerometerchain:rotationfilter:compasschain").split(":", Qt::SkipEmptyParts); +#else return QString("accelerometerchain:rotationfilter:compasschain").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/stepcountersensor/stepcounterplugin.cpp b/sensors/stepcountersensor/stepcounterplugin.cpp index 219be93d..67805bbe 100644 --- a/sensors/stepcountersensor/stepcounterplugin.cpp +++ b/sensors/stepcountersensor/stepcounterplugin.cpp @@ -45,5 +45,9 @@ void StepCounterPlugin::Init(class Loader& l) } QStringList StepCounterPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("stepcounteradaptor").split(":", Qt::SkipEmptyParts); +#else return QString("stepcounteradaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/tapsensor/tapplugin.cpp b/sensors/tapsensor/tapplugin.cpp index de67c377..1142734f 100644 --- a/sensors/tapsensor/tapplugin.cpp +++ b/sensors/tapsensor/tapplugin.cpp @@ -37,5 +37,9 @@ void TapPlugin::Register(class Loader&) } QStringList TapPlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("tapadaptor").split(":", Qt::SkipEmptyParts); +#else return QString("tapadaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/sensors/temperaturesensor/temperatureplugin.cpp b/sensors/temperaturesensor/temperatureplugin.cpp index 49c0becc..5200a39c 100644 --- a/sensors/temperaturesensor/temperatureplugin.cpp +++ b/sensors/temperaturesensor/temperatureplugin.cpp @@ -42,5 +42,9 @@ void TemperaturePlugin::Init(class Loader& l) } QStringList TemperaturePlugin::Dependencies() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QString("temperatureadaptor").split(":", Qt::SkipEmptyParts); +#else return QString("temperatureadaptor").split(":", QString::SkipEmptyParts); +#endif } diff --git a/tests/benchmark/benchmarktest/benchmarktest.pro b/tests/benchmark/benchmarktest/benchmarktest.pro index 8898f068..3911047e 100644 --- a/tests/benchmark/benchmarktest/benchmarktest.pro +++ b/tests/benchmark/benchmarktest/benchmarktest.pro @@ -25,4 +25,4 @@ QMAKE_LIBDIR_FLAGS += -L../../../qt-api \ -L../../../datatypes \ -L../../../core -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorclient-qt$${QT_MAJOR_VERSION} diff --git a/tests/benchmark/benchmarktest/signaldump.h b/tests/benchmark/benchmarktest/signaldump.h index 1c149ec0..4cca3bae 100644 --- a/tests/benchmark/benchmarktest/signaldump.h +++ b/tests/benchmark/benchmarktest/signaldump.h @@ -74,13 +74,25 @@ class SignalDump : public QObject while (!line.isEmpty()) { if (*(line.constData()) == 'P' || *(line.constData()) == 'S') { if (strncmp(line.constData(), "Private_Clean", 13) == 0) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + clean += atoi(QString(line).split(' ', Qt::SkipEmptyParts).at(1).toLocal8Bit().constData()); +#else clean += atoi(QString(line).split(' ', QString::SkipEmptyParts).at(1).toLocal8Bit().constData()); +#endif } else if (strncmp(line.constData(), "Private_Dirty", 13) == 0) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + dirty += atoi(QString(line).split(' ', Qt::SkipEmptyParts).at(1).toLocal8Bit().constData()); +#else dirty += atoi(QString(line).split(' ', QString::SkipEmptyParts).at(1).toLocal8Bit().constData()); +#endif } else if (strncmp(line.constData(), "Swap", 4) == 0) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + dirty += atoi(QString(line).split(' ', Qt::SkipEmptyParts).at(1).toLocal8Bit().constData()); +#else dirty += atoi(QString(line).split(' ', QString::SkipEmptyParts).at(1).toLocal8Bit().constData()); +#endif } } line.clear(); diff --git a/tests/benchmark/dummyclient/dummyclient.pro b/tests/benchmark/dummyclient/dummyclient.pro index 47a1c37d..9dbb9d70 100644 --- a/tests/benchmark/dummyclient/dummyclient.pro +++ b/tests/benchmark/dummyclient/dummyclient.pro @@ -16,4 +16,4 @@ QMAKE_LIBDIR_FLAGS += -L../../../qt-api \ -L../../../datatypes \ -L../../../core -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorclient-qt$${QT_MAJOR_VERSION} diff --git a/tests/client/client.pro b/tests/client/client.pro index 55b01625..7d71221d 100644 --- a/tests/client/client.pro +++ b/tests/client/client.pro @@ -25,4 +25,4 @@ INCLUDEPATH += $$SENSORFW_INCLUDEPATHS QMAKE_LIBDIR_FLAGS += -L../../qt-api \ -L../../datatypes -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorclient-qt$${QT_MAJOR_VERSION} diff --git a/tests/common-install.pri b/tests/common-install.pri index b51210b4..235f8654 100644 --- a/tests/common-install.pri +++ b/tests/common-install.pri @@ -4,7 +4,7 @@ include(../common-config.pri) QMAKE_LIBDIR_FLAGS += -L../../datatypes -L../../../datatypes -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} target.path = /usr/bin INSTALLS += target diff --git a/tests/deadclient/deadclient.pro b/tests/deadclient/deadclient.pro index 18db93b6..da0522e1 100644 --- a/tests/deadclient/deadclient.pro +++ b/tests/deadclient/deadclient.pro @@ -16,7 +16,7 @@ INCLUDEPATH += ../../ \ QMAKE_LIBDIR_FLAGS += -L../../qt-api \ -L../../datatypes -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorclient-qt$${QT_MAJOR_VERSION} # Input HEADERS += datareceiver.h testwindow.h diff --git a/tests/metadata/metadata.pro b/tests/metadata/metadata.pro index cc3890b7..078f84f4 100644 --- a/tests/metadata/metadata.pro +++ b/tests/metadata/metadata.pro @@ -23,7 +23,7 @@ INCLUDEPATH += $$SENSORFW_INCLUDEPATHS QMAKE_LIBDIR_FLAGS += -L../../qt-api \ -L../../datatypes -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorclient-qt$${QT_MAJOR_VERSION} #CONFIG += link_pkgconfig #PKGCONFIG += mlite5 diff --git a/tests/powermanagement/driverpolltest/driverpolltest.pro b/tests/powermanagement/driverpolltest/driverpolltest.pro index 61d0d1c6..c542fc58 100644 --- a/tests/powermanagement/driverpolltest/driverpolltest.pro +++ b/tests/powermanagement/driverpolltest/driverpolltest.pro @@ -24,4 +24,4 @@ QMAKE_LIBDIR_FLAGS += -L../../../qt-api \ -L../../../datatypes\ -L../../../core -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorclient-qt$${QT_MAJOR_VERSION} diff --git a/tests/powermanagement/powermanagementtests/powermanagementtests.pro b/tests/powermanagement/powermanagementtests/powermanagementtests.pro index a7f34b84..3fb007bd 100644 --- a/tests/powermanagement/powermanagementtests/powermanagementtests.pro +++ b/tests/powermanagement/powermanagementtests/powermanagementtests.pro @@ -24,7 +24,7 @@ QMAKE_LIBDIR_FLAGS += -L../../../qt-api \ -L../../../datatypes\ -L../../../core -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorclient-qt$${QT_MAJOR_VERSION} #CONFIG += link_pkgconfig #PKGCONFIG += mlite5 diff --git a/tests/powermanagement/standbyoverridetests/standbyoverridetests.pro b/tests/powermanagement/standbyoverridetests/standbyoverridetests.pro index d95c6248..13254c55 100644 --- a/tests/powermanagement/standbyoverridetests/standbyoverridetests.pro +++ b/tests/powermanagement/standbyoverridetests/standbyoverridetests.pro @@ -25,7 +25,7 @@ QMAKE_LIBDIR_FLAGS += -L../../../qt-api \ -L../../../datatypes\ -L../../../core -QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt$${QT_MAJOR_VERSION} -lsensorclient-qt$${QT_MAJOR_VERSION} #CONFIG += link_pkgconfig #PKGCONFIG += mlite5 diff --git a/tests/testapp/testapp.pro b/tests/testapp/testapp.pro index ee46dcac..3afdfe81 100644 --- a/tests/testapp/testapp.pro +++ b/tests/testapp/testapp.pro @@ -36,7 +36,7 @@ QMAKE_LIBDIR_FLAGS += -L../../qt-api\ -L../../datatypes \ -L../../core -QMAKE_LIBDIR_FLAGS += -lsensorclient-qt5 +QMAKE_LIBDIR_FLAGS += -lsensorclient-qt$${QT_MAJOR_VERSION} include(../../common.pri) diff --git a/tests/testutils/datafaker/main.cpp b/tests/testutils/datafaker/main.cpp index 41c2c310..093aba9a 100644 --- a/tests/testutils/datafaker/main.cpp +++ b/tests/testutils/datafaker/main.cpp @@ -74,7 +74,11 @@ int main(int argc, char** argv) break; } QString line(buffer); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QStringList numberList = line.split(" ", Qt::SkipEmptyParts); +#else QStringList numberList = line.split(" ", QString::SkipEmptyParts); +#endif if (numberList.length() % 3 != 0) { qDebug() << "Too many / too few numbers on line, skipping:" << line; }