Fix build for Qt versions older than 5.10

This commit is contained in:
Martin Kleusberg
2021-01-22 16:32:12 +01:00
parent 7382ed882b
commit 42ce8995c8
+3 -3
View File
@@ -99,11 +99,11 @@ std::string CondFormat::filterToSqlCondition(const QString& value, const QString
op = value.left(2);
val = value.mid(2);
}
} else if(value.front() == '>' || value.front() == '<') {
} else if(value.at(0) == '>' || value.at(0) == '<') {
value.midRef(1).toFloat(&numeric);
op = value.at(0);
val = value.mid(1);
} else if(value.front() == '=') {
} else if(value.at(0) == '=') {
val = value.mid(1);
// Check if value to compare with is 'NULL'
@@ -117,7 +117,7 @@ std::string CondFormat::filterToSqlCondition(const QString& value, const QString
op = "IS";
numeric = true;
}
} else if(value.front() == '/' && value.back() == '/' && value.size() > 2) {
} else if(value.at(0) == '/' && value.at(value.size()-1) == '/' && value.size() > 2) {
val = value.mid(1, value.length() - 2);
op = "REGEXP";
numeric = false;