diff --git a/src/Camera/QGCCameraControl.cc b/src/Camera/QGCCameraControl.cc index 4928d527aaf076e06791c3b8ba180aad989f799b..3a5d8a5cf2ada70426b017ef022b0ed75cfdf1e2 100644 --- a/src/Camera/QGCCameraControl.cc +++ b/src/Camera/QGCCameraControl.cc @@ -1274,17 +1274,26 @@ QGCCameraControl::_processConditionTest(const QString conditionTest) qCDebug(CameraControlVerboseLog) << "_processConditionTest(" << conditionTest << ")"; int op = TEST_NONE; QStringList test; + + auto split = [&conditionTest](const QString& sep ) { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + return conditionTest.split(sep, QString::SkipEmptyParts); +#else + return conditionTest.split(sep, Qt::SkipEmptyParts); +#endif + }; + if(conditionTest.contains("!=")) { - test = conditionTest.split("!=", QString::SkipEmptyParts); + test = split("!="); op = TEST_NOT_EQUAL; } else if(conditionTest.contains("=")) { - test = conditionTest.split("=", QString::SkipEmptyParts); + test = split("="); op = TEST_EQUAL; } else if(conditionTest.contains(">")) { - test = conditionTest.split(">", QString::SkipEmptyParts); + test = split(">"); op = TEST_GREATER; } else if(conditionTest.contains("<")) { - test = conditionTest.split("<", QString::SkipEmptyParts); + test = split("<"); op = TEST_SMALLER; } if(test.size() == 2) { @@ -1319,7 +1328,11 @@ QGCCameraControl::_processCondition(const QString condition) bool result = true; bool andOp = true; if(!condition.isEmpty()) { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) QStringList scond = condition.split(" ", QString::SkipEmptyParts); +#else + QStringList scond = condition.split(" ", Qt::SkipEmptyParts); +#endif while(scond.size()) { QString test = scond.first(); scond.removeFirst();