Drop support of Qt 5

Also remove usage of some deprecated stuff.

PR #19338.
This commit is contained in:
Vladimir Golovnev 2023-07-20 11:17:27 +03:00 committed by GitHub
parent 5e610cfdcf
commit dbe79484d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 48 additions and 462 deletions

View file

@ -32,15 +32,10 @@
#include <cmath>
#include <QLocale>
#include <QRegularExpression>
#include <QStringList>
#include <QVector>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QRegularExpression>
#else
#include <QRegExp>
#endif
// to send numbers instead of strings with suffixes
QString Utils::String::fromDouble(const double n, const int precision)
{
@ -54,21 +49,10 @@ QString Utils::String::fromDouble(const double n, const int precision)
return QLocale::system().toString(std::floor(n * prec) / prec, 'f', precision);
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
QString Utils::String::wildcardToRegexPattern(const QString &pattern)
{
return QRegularExpression::wildcardToRegularExpression(pattern, QRegularExpression::UnanchoredWildcardConversion);
}
#else
// This is marked as internal in QRegExp.cpp, but is exported. The alternative would be to
// copy the code from QRegExp::wc2rx().
QString qt_regexp_toCanonical(const QString &pattern, QRegExp::PatternSyntax patternSyntax);
QString Utils::String::wildcardToRegexPattern(const QString &pattern)
{
return qt_regexp_toCanonical(pattern, QRegExp::Wildcard);
}
#endif
QStringList Utils::String::splitCommand(const QString &command)
{