25using namespace Qt::StringLiterals;
36 const QString pre =
string.section(
'-', 0, 0 );
37 const QStringList fileVersionParts = pre.section(
'-', 0 ).split(
'.' );
39 mMajor = fileVersionParts.at( 0 ).toInt();
40 if ( fileVersionParts.size() > 1 )
42 mMinor = fileVersionParts.at( 1 ).toInt();
44 if ( fileVersionParts.size() > 2 )
46 mSub = fileVersionParts.at( 2 ).toInt();
48 mName =
string.section(
'-', 1 );
55 return ( ( mMajor == other.mMajor ) && ( mMinor == other.mMinor ) && ( mSub == other.mSub ) );
60 return ( ( mMajor != other.mMajor ) || ( mMinor != other.mMinor ) || ( mSub != other.mSub ) );
65 return ( *
this == other ) || ( *
this > other );
70 return ( ( mMajor > other.mMajor ) || ( ( mMajor == other.mMajor ) && ( mMinor > other.mMinor ) ) || ( ( mMajor == other.mMajor ) && ( mMinor == other.mMinor ) && ( mSub > other.mSub ) ) );
80 return other >= *
this;
86 if ( mName.isEmpty() )
88 return u
"%1.%2.%3"_s.arg( mMajor ).arg( mMinor ).arg( mSub );
92 return u
"%1.%2.%3-%4"_s.arg( mMajor ).arg( mMinor ).arg( mSub ).arg( mName );
98 return mMajor == 0 && mMinor == 0 && mSub == 0;
bool operator>(const QgsProjectVersion &other) const
bool operator!=(const QgsProjectVersion &other) const
QString text() const
Returns a string representation of the version.
bool operator<(const QgsProjectVersion &other) const
bool operator==(const QgsProjectVersion &other) const
bool operator>=(const QgsProjectVersion &other) const
bool operator<=(const QgsProjectVersion &other) const
bool isNull() const
Returns true if this is a NULL project version.
QgsProjectVersion()=default
Creates a new NULL version.
#define QgsDebugMsgLevel(str, level)