From c36342371819a4983b5ac2b928acc6a78b857ed8 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu <contact@scrumplex.net> Date: Mon, 2 May 2022 21:34:55 +0200 Subject: refactor: fix deprecation up to Qt 6 Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net> --- launcher/Version.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'launcher/Version.h') diff --git a/launcher/Version.h b/launcher/Version.h index 9fe12d6d..292e2a18 100644 --- a/launcher/Version.h +++ b/launcher/Version.h @@ -1,6 +1,7 @@ #pragma once #include <QString> +#include <QStringView> #include <QList> class QUrl; @@ -39,13 +40,21 @@ private: break; } } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + auto numPart = QStringView{m_fullString}.left(cutoff); +#else auto numPart = m_fullString.leftRef(cutoff); +#endif if(numPart.size()) { numValid = true; m_numPart = numPart.toInt(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + auto stringPart = QStringView{m_fullString}.mid(cutoff); +#else auto stringPart = m_fullString.midRef(cutoff); +#endif if(stringPart.size()) { m_stringPart = stringPart.toString(); -- cgit