Class: QgsProjectVersion

class qgis.core.QgsProjectVersion

Bases: sip.wrapper

A class to describe the version of a project.

Used in places where you need to check if the current version of QGIS is greater than the one used to create a project file.

QgsProjectVersion() Creates a new NULL version

QgsProjectVersion(major: int, minor: int, sub: int, name: str = ‘’) Constructor for QgsProjectVersion, with the specified major, minor and sub version numbers.

QgsProjectVersion(string: str) Constructor for QgsProjectVersion, which parses the version number from a string.

QgsProjectVersion(QgsProjectVersion)

Methods

isNull

Returns True if this is a NULL project version.

majorVersion

Returns the major version number.

minorVersion

Returns the minor version number.

subVersion

Returns the sub version number.

text

Returns a string representation of the version.

isNull(self) bool

Returns True if this is a NULL project version.

Return type:

bool

majorVersion(self) int

Returns the major version number.

Return type:

int

minorVersion(self) int

Returns the minor version number.

Return type:

int

subVersion(self) int

Returns the sub version number.

Return type:

int

text(self) str

Returns a string representation of the version.

Return type:

str