IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QTypeRevision Class

The QTypeRevision class contains a lightweight representation of a version number with two 8-bit segments, major and minor, either of which can be unknown.

This class was introduced in Qt 6.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QTypeRevision Class

  • Header: QTypeRevision

  • Since: Qt 6.0

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Core)

    target_link_libraries(mytarget PRIVATE Qt6::Core)

  • qmake: QT += core

Detailed Description

Use this class to describe revisions of a type. Compatible revisions can be expressed as increments of the minor version. Breaking changes can be expressed as increments of the major version. The return values of QMetaMethod::revision() and QMetaProperty::revision() can be passed to QTypeRevision::fromEncodedVersion(). The resulting major and minor versions specify in which Qt versions the properties and methods were added.

See Also

Member Function Documentation

 

[constexpr] QTypeRevision::QTypeRevision()

Produces an invalid revision.

See Also

See also isValid()

[static constexpr] QTypeRevision QTypeRevision::fromEncodedVersion(Integer value)

Produces a QTypeRevision from the given value. value encodes both the minor and major versions in the least significant and second least significant byte, respectively.

value must not have any bits outside the least significant two bytes set. Integer needs to be at least 16 bits wide, and must not have a sign bit in the least significant 16 bits.

See Also

See also toEncodedVersion()

[static constexpr] QTypeRevision QTypeRevision::fromMajorVersion(Major majorVersion)

Produces a QTypeRevision from the given majorVersion with an invalid minor version. majorVersion needs to be a valid segment.

See Also

See also isValidSegment()

[static constexpr] QTypeRevision QTypeRevision::fromMinorVersion(Minor minorVersion)

Produces a QTypeRevision from the given minorVersion with an invalid major version. minorVersion needs to be a valid segment.

See Also

See also isValidSegment()

[static constexpr] QTypeRevision QTypeRevision::fromVersion(Major majorVersion, Minor minorVersion)

Produces a QTypeRevision from the given majorVersion and minorVersion, both of which need to be a valid segments.

See Also

See also isValidSegment()

[constexpr] bool QTypeRevision::hasMajorVersion() const

Returns true if the major version is known, otherwise false.

See Also

[constexpr] bool QTypeRevision::hasMinorVersion() const

Returns true if the minor version is known, otherwise false.

See Also

[constexpr] bool QTypeRevision::isValid() const

Returns true if the major version or the minor version is known, otherwise false.

See Also

[static constexpr] bool QTypeRevision::isValidSegment(Integer segment)

Returns true if the given number can be used as either major or minor version in a QTypeRevision. The valid range for segment is >= 0 and < 255.

[constexpr] quint8 QTypeRevision::majorVersion() const

Returns the major version encoded in the revision.

See Also

[constexpr] quint8 QTypeRevision::minorVersion() const

Returns the minor version encoded in the revision.

See Also

[constexpr] Integer QTypeRevision::toEncodedVersion() const

Transforms the revision into an integer value, encoding the minor version into the least significant byte, and the major version into the second least significant byte.

Integer needs to be at least 16 bits wide, and must not have a sign bit in the least significant 16 bits.

See Also

See also fromEncodedVersion()

[static constexpr] QTypeRevision QTypeRevision::zero()

Produces a QTypeRevision with major and minor version 0.

Related Non-Members

 

[since 6.0] QDataStream &operator<<(QDataStream &out, const QTypeRevision &revision)

Writes the revision revision to stream out.

This function was introduced in Qt 6.0.

[since 6.0] QDataStream &operator>>(QDataStream &in, QTypeRevision &revision)

Reads a revision from stream in and stores it in revision.

This function was introduced in Qt 6.0.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+