diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-05-02 21:34:55 +0200 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-07-10 12:19:15 +0200 |
commit | c36342371819a4983b5ac2b928acc6a78b857ed8 (patch) | |
tree | 925d5ef6756a205feddc40864c0717e0c6472d44 /launcher/Version.h | |
parent | e58158c3cd629717a9742fe08da9b09ed39bc198 (diff) | |
download | PrismLauncher-c36342371819a4983b5ac2b928acc6a78b857ed8.tar.gz PrismLauncher-c36342371819a4983b5ac2b928acc6a78b857ed8.tar.bz2 PrismLauncher-c36342371819a4983b5ac2b928acc6a78b857ed8.zip |
refactor: fix deprecation up to Qt 6
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/Version.h')
-rw-r--r-- | launcher/Version.h | 9 |
1 files changed, 9 insertions, 0 deletions
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(); |