refactor: fix deprecation up to Qt 6
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user