forked from qt-creator/qt-creator
Fix compilation of sdktool against old Qt versions
Amends 6c5eaed92c
Change-Id: Ia664ea16767e9787252ec529061c7d5f5d89a7de
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -399,6 +399,9 @@ QString formatElapsedTime(qint64 elapsed)
|
|||||||
*/
|
*/
|
||||||
QString wildcardToRegularExpression(const QString &original)
|
QString wildcardToRegularExpression(const QString &original)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
|
||||||
|
using qsizetype = int;
|
||||||
|
#endif
|
||||||
const qsizetype wclen = original.size();
|
const qsizetype wclen = original.size();
|
||||||
QString rx;
|
QString rx;
|
||||||
rx.reserve(wclen + wclen / 16);
|
rx.reserve(wclen + wclen / 16);
|
||||||
@@ -455,6 +458,10 @@ QString wildcardToRegularExpression(const QString &original)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
||||||
return QRegularExpression::anchoredPattern(rx);
|
return QRegularExpression::anchoredPattern(rx);
|
||||||
|
#else
|
||||||
|
return "\\A" + rx + "\\z";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
Reference in New Issue
Block a user