![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qversionnumber.h>
Public Types | |
| using | const_iterator = It |
| using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
| using | value_type = It::value_type |
| using | difference_type = It::difference_type |
| using | size_type = It::size_type |
| using | reference = It::reference |
| using | const_reference = reference |
| using | pointer = It::pointer |
| using | const_pointer = pointer |
Public Member Functions | |
| QVersionNumber () noexcept | |
| Produces a null version. | |
| Q_WEAK_OVERLOAD | QVersionNumber (const QList< int > &seg) |
| Constructs a version number from the list of numbers contained in seg. | |
| Q_WEAK_OVERLOAD | QVersionNumber (QList< int > &&seg) |
| Move-constructs a version number from the list of numbers contained in seg. | |
| QVersionNumber (std::initializer_list< int > args) | |
| Constructs a version number from the std::initializer_list specified by args. | |
| QVersionNumber (QSpan< const int > args) | |
| QVersionNumber (int maj) | |
| Constructs a QVersionNumber consisting of just the major version number maj. | |
| QVersionNumber (int maj, int min) | |
| Constructs a QVersionNumber consisting of the major and minor version numbers maj and min, respectively. | |
| QVersionNumber (int maj, int min, int mic) | |
| Constructs a QVersionNumber consisting of the major, minor, and micro version numbers maj, min and mic, respectively. | |
| bool | isNull () const noexcept |
Returns true if there are zero numerical segments, otherwise returns false. | |
| bool | isNormalized () const noexcept |
Returns true if the version number does not contain any trailing zeros, otherwise returns false. | |
| int | majorVersion () const noexcept |
| Returns the major version number, that is, the first segment. | |
| int | minorVersion () const noexcept |
| Returns the minor version number, that is, the second segment. | |
| int | microVersion () const noexcept |
| Returns the micro version number, that is, the third segment. | |
| Q_CORE_EXPORT QVersionNumber | normalized () const |
| Returns an equivalent version number but with all trailing zeros removed. | |
| Q_CORE_EXPORT QList< int > | segments () const |
| Returns all of the numerical segments. | |
| int | segmentAt (qsizetype index) const noexcept |
| Returns the segment value at index. | |
| qsizetype | segmentCount () const noexcept |
| Returns the number of integers stored in segments(). | |
| const_iterator | begin () const noexcept |
| const_iterator | end () const noexcept |
| const_iterator | cbegin () const noexcept |
| const_iterator | cend () const noexcept |
| const_reverse_iterator | rbegin () const noexcept |
| const_reverse_iterator | rend () const noexcept |
| const_reverse_iterator | crbegin () const noexcept |
| const_reverse_iterator | crend () const noexcept |
| const_iterator | constBegin () const noexcept |
| const_iterator | constEnd () const noexcept |
| Q_CORE_EXPORT bool | isPrefixOf (const QVersionNumber &other) const noexcept |
Returns true if the current version number is contained in the other version number, otherwise returns false. | |
| Q_CORE_EXPORT QString | toString () const |
Returns a string with all of the segments delimited by a period ({.}). | |
Static Public Member Functions | |
| static Q_CORE_EXPORT int | compare (const QVersionNumber &v1, const QVersionNumber &v2) noexcept |
| Compares v1 with v2 and returns an integer less than, equal to, or greater than zero, depending on whether v1 is less than, equal to, or greater than v2, respectively. | |
| static Q_CORE_EXPORT QVersionNumber | commonPrefix (const QVersionNumber &v1, const QVersionNumber &v2) |
| QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1,
const QVersionNumber &v2). | |
| static Q_CORE_EXPORT QVersionNumber | fromString (QAnyStringView string, qsizetype *suffixIndex=nullptr) |
Friends | |
| class | QTypeInfo< SegmentStorage > |
| bool | comparesEqual (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept |
| Qt::strong_ordering | compareThreeWay (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept |
| Q_CORE_EXPORT QDataStream & | operator>> (QDataStream &in, QVersionNumber &version) |
| Reads a version number from stream in and stores it in version. | |
| Q_CORE_EXPORT size_t | qHash (const QVersionNumber &key, size_t seed=0) |
| \qhashold{QHash} | |
Related Symbols | |
(Note that these are not member symbols.) | |
| QDataStream & | operator<< (QDataStream &out, const QVersionNumber &version) |
| Writes the version number version to stream out. | |
\inmodule QtCore
The QVersionNumber class contains a version number with an arbitrary number of segments.
\compares strong
Definition at line 32 of file qversionnumber.h.
| using QVersionNumber::const_iterator = It |
Definition at line 274 of file qversionnumber.h.
| using QVersionNumber::const_pointer = pointer |
Provided for STL-compatibility.
Definition at line 283 of file qversionnumber.h.
Definition at line 281 of file qversionnumber.h.
| using QVersionNumber::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Typedefs for an opaque class that implements a (reverse) random-access iterator over QVersionNumber segments.
Definition at line 275 of file qversionnumber.h.
| using QVersionNumber::difference_type = It::difference_type |
Definition at line 278 of file qversionnumber.h.
| using QVersionNumber::pointer = It::pointer |
Definition at line 282 of file qversionnumber.h.
| using QVersionNumber::reference = It::reference |
Definition at line 280 of file qversionnumber.h.
| using QVersionNumber::size_type = It::size_type |
Definition at line 279 of file qversionnumber.h.
| using QVersionNumber::value_type = It::value_type |
Definition at line 277 of file qversionnumber.h.
|
inlinenoexcept |
Produces a null version.
Definition at line 285 of file qversionnumber.h.
References QVersionNumber().
Referenced by QVersionNumber(), and CPP::colorRoleVersionAdded().
|
inlineexplicit |
Constructs a version number from the list of numbers contained in seg.
Definition at line 289 of file qversionnumber.h.
|
inlineexplicit |
Move-constructs a version number from the list of numbers contained in seg.
Definition at line 294 of file qversionnumber.h.
|
inline |
Constructs a version number from the std::initializer_list specified by args.
Definition at line 296 of file qversionnumber.h.
References QVersionNumber().
Referenced by QVersionNumber().
|
inlineexplicit |
Constructs a version number from the span specified by args.
Definition at line 300 of file qversionnumber.h.
|
inlineexplicit |
Constructs a QVersionNumber consisting of just the major version number maj.
Definition at line 304 of file qversionnumber.h.
|
inlineexplicit |
Constructs a QVersionNumber consisting of the major and minor version numbers maj and min, respectively.
Definition at line 307 of file qversionnumber.h.
|
inlineexplicit |
Constructs a QVersionNumber consisting of the major, minor, and micro version numbers maj, min and mic, respectively.
Definition at line 310 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Definition at line 338 of file qversionnumber.h.
Referenced by cbegin(), and constBegin().
|
inlinenodiscardnoexcept |
Definition at line 340 of file qversionnumber.h.
References begin().
|
inlinenodiscardnoexcept |
Definition at line 341 of file qversionnumber.h.
References end().
|
staticnodiscard |
QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2).
Returns a version number that is a parent version of both v1 and v2.
Definition at line 333 of file qversionnumber.cpp.
|
staticnodiscardnoexcept |
Compares v1 with v2 and returns an integer less than, equal to, or greater than zero, depending on whether v1 is less than, equal to, or greater than v2, respectively.
Comparisons are performed by comparing the segments of v1 and v2 starting at index 0 and working towards the end of the longer list.
Definition at line 284 of file qversionnumber.cpp.
|
inlinenodiscardnoexcept |
Definition at line 348 of file qversionnumber.h.
References begin().
|
inlinenodiscardnoexcept |
Returns a const_iterator or const_reverse_iterator, respectively, pointing to the first or one past the last segment of this version number.
Definition at line 349 of file qversionnumber.h.
References end().
|
inlinenodiscardnoexcept |
Definition at line 345 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Definition at line 346 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Definition at line 339 of file qversionnumber.h.
Referenced by cend(), and constEnd().
|
staticnodiscard |
Constructs a QVersionNumber from a specially formatted string of non-negative decimal numbers delimited by a period ({.}).
Once the numerical segments have been parsed, the remainder of the string is considered to be the suffix string. The start index of that string will be stored in suffixIndex if it is not null.
{int*}.Definition at line 490 of file qversionnumber.cpp.
|
inlinenodiscardnoexcept |
Returns true if the version number does not contain any trailing zeros, otherwise returns false.
Definition at line 316 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Returns true if there are zero numerical segments, otherwise returns false.
Definition at line 313 of file qversionnumber.h.
|
nodiscardnoexcept |
Returns true if the current version number is contained in the other version number, otherwise returns false.
Definition at line 260 of file qversionnumber.cpp.
|
inlinenodiscardnoexcept |
Returns the major version number, that is, the first segment.
This function is equivalent to segmentAt(0). If this QVersionNumber object is null, this function returns 0.
Definition at line 319 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Returns the micro version number, that is, the third segment.
This function is equivalent to segmentAt(2). If this QVersionNumber object does not contain a micro number, this function returns 0.
Definition at line 325 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Returns the minor version number, that is, the second segment.
This function is equivalent to segmentAt(1). If this QVersionNumber object does not contain a minor number, this function returns 0.
Definition at line 322 of file qversionnumber.h.
|
nodiscard |
Returns an equivalent version number but with all trailing zeros removed.
To check if two numbers are equivalent, use normalized() on both version numbers before performing the compare.
Definition at line 238 of file qversionnumber.cpp.
|
inlinenodiscardnoexcept |
Definition at line 343 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Definition at line 344 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Returns the segment value at index.
If the index does not exist, returns 0.
Definition at line 332 of file qversionnumber.h.
|
inlinenodiscardnoexcept |
Returns the number of integers stored in segments().
Definition at line 335 of file qversionnumber.h.
|
nodiscard |
Returns all of the numerical segments.
Definition at line 150 of file qversionnumber.cpp.
|
nodiscard |
Returns a string with all of the segments delimited by a period ({.}).
Definition at line 411 of file qversionnumber.cpp.
|
friend |
Definition at line 387 of file qversionnumber.h.
|
friend |
Definition at line 392 of file qversionnumber.h.
|
Writes the version number version to stream out.
Note that this has nothing to do with QDataStream::version().
|
friend |
Reads a version number from stream in and stores it in version.
Note that this has nothing to do with QDataStream::version().
Definition at line 555 of file qversionnumber.cpp.
|
friend |
|
friend |
Definition at line 48 of file qversionnumber.h.