35 const QString pre =
string.section(
'-', 0, 0 );
36 const QStringList fileVersionParts = pre.section(
'-', 0 ).split(
'.' );
38 mMajor = fileVersionParts.at( 0 ).toInt();
39 if ( fileVersionParts.size() > 1 )
41 mMinor = fileVersionParts.at( 1 ).toInt();
43 if ( fileVersionParts.size() > 2 )
45 mSub = fileVersionParts.at( 2 ).toInt();
47 mName =
string.section(
'-', 1 );
54 return ( ( mMajor == other.mMajor ) &&
55 ( mMinor == other.mMinor ) &&
56 ( mSub == other.mSub ) );
61 return ( ( mMajor != other.mMajor ) ||
62 ( mMinor != other.mMinor ) ||
63 ( mSub != other.mSub ) );
68 return ( *
this == other ) || ( *
this > other );
73 return ( ( mMajor > other.mMajor ) ||
74 ( ( mMajor == other.mMajor ) && ( mMinor > other.mMinor ) ) ||
75 ( ( mMajor == other.mMajor ) && ( mMinor == other.mMinor ) && ( mSub > other.mSub ) ) );
85 return other >= *
this;
91 if ( mName.isEmpty() )
93 return QStringLiteral(
"%1.%2.%3" ).arg( mMajor ).arg( mMinor ).arg( mSub );
97 return QStringLiteral(
"%1.%2.%3-%4" ).arg( mMajor ).arg( mMinor ).arg( mSub ).arg( mName );
103 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)