Struct qt_core::QVersionNumber
source · #[repr(C)]pub struct QVersionNumber { /* private fields */ }
Expand description
The QVersionNumber class contains a version number with an arbitrary number of segments.
C++ class: QVersionNumber
.
The QVersionNumber class contains a version number with an arbitrary number of segments.
QVersionNumber version(1, 2, 3); // 1.2.3
Implementations§
source§impl QVersionNumber
impl QVersionNumber
sourcepub unsafe fn common_prefix(
v1: impl CastInto<Ref<QVersionNumber>>,
v2: impl CastInto<Ref<QVersionNumber>>
) -> CppBox<QVersionNumber>
pub unsafe fn common_prefix( v1: impl CastInto<Ref<QVersionNumber>>, v2: impl CastInto<Ref<QVersionNumber>> ) -> CppBox<QVersionNumber>
QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2)
Calls C++ function: static QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber& v1, const QVersionNumber& v2)
.
QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2)
Returns a version number that is a parent version of both v1 and v2.
See also isPrefixOf().
sourcepub unsafe fn compare(
v1: impl CastInto<Ref<QVersionNumber>>,
v2: impl CastInto<Ref<QVersionNumber>>
) -> c_int
pub unsafe fn compare( v1: impl CastInto<Ref<QVersionNumber>>, v2: impl CastInto<Ref<QVersionNumber>> ) -> c_int
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.
Calls C++ function: static int QVersionNumber::compare(const QVersionNumber& v1, const QVersionNumber& v2)
.
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.
QVersionNumber v1(1, 2); QVersionNumber v2(1, 2, 0); int compare = QVersionNumber::compare(v1, v2); // compare == -1
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QVersionNumber>>
) -> Ref<QVersionNumber>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QVersionNumber>> ) -> Ref<QVersionNumber>
The QVersionNumber class contains a version number with an arbitrary number of segments.
Calls C++ function: QVersionNumber& QVersionNumber::operator=(const QVersionNumber& other)
.
The QVersionNumber class contains a version number with an arbitrary number of segments.
QVersionNumber version(1, 2, 3); // 1.2.3
sourcepub unsafe fn from_string_q_string_int(
string: impl CastInto<Ref<QString>>,
suffix_index: *mut c_int
) -> CppBox<QVersionNumber>
pub unsafe fn from_string_q_string_int( string: impl CastInto<Ref<QString>>, suffix_index: *mut c_int ) -> CppBox<QVersionNumber>
Constructs a QVersionNumber from a specially formatted string of non-negative decimal numbers delimited by a period (.
).
Calls C++ function: static QVersionNumber QVersionNumber::fromString(const QString& string, int* suffixIndex = …)
.
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.
QString string(“5.4.0-alpha”); int suffixIndex; QVersionNumber version = QVersionNumber::fromString(string, &suffixIndex); // version is 5.4.0 // suffixIndex is 5
See also isNull().
sourcepub unsafe fn from_string_q_string(
string: impl CastInto<Ref<QString>>
) -> CppBox<QVersionNumber>
pub unsafe fn from_string_q_string( string: impl CastInto<Ref<QString>> ) -> CppBox<QVersionNumber>
Constructs a QVersionNumber from a specially formatted string of non-negative decimal numbers delimited by a period (.
).
Calls C++ function: static QVersionNumber QVersionNumber::fromString(const QString& string)
.
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.
QString string(“5.4.0-alpha”); int suffixIndex; QVersionNumber version = QVersionNumber::fromString(string, &suffixIndex); // version is 5.4.0 // suffixIndex is 5
See also isNull().
sourcepub unsafe fn from_string_q_latin1_string_int(
string: impl CastInto<Ref<QLatin1String>>,
suffix_index: *mut c_int
) -> CppBox<QVersionNumber>
pub unsafe fn from_string_q_latin1_string_int( string: impl CastInto<Ref<QLatin1String>>, suffix_index: *mut c_int ) -> CppBox<QVersionNumber>
This is an overloaded function.
Calls C++ function: static QVersionNumber QVersionNumber::fromString(QLatin1String string, int* suffixIndex = …)
.
This is an overloaded function.
Constructs a QVersionNumber from a specially formatted string of non-negative decimal numbers delimited by '.'.
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.
QLatin1String string(“5.4.0-alpha”); int suffixIndex; auto version = QVersionNumber::fromString(string, &suffixIndex); // version is 5.4.0 // suffixIndex is 5
This function was introduced in Qt 5.10.
See also isNull().
sourcepub unsafe fn from_string_q_string_view_int(
string: impl CastInto<Ref<QStringView>>,
suffix_index: *mut c_int
) -> CppBox<QVersionNumber>
Available on cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn from_string_q_string_view_int( string: impl CastInto<Ref<QStringView>>, suffix_index: *mut c_int ) -> CppBox<QVersionNumber>
cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.This is an overloaded function.
Calls C++ function: static QVersionNumber QVersionNumber::fromString(QStringView string, int* suffixIndex = …)
.
This is an overloaded function.
Constructs a QVersionNumber from a specially formatted string of non-negative decimal numbers delimited by '.'.
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.
QString string(“5.4.0-alpha”); int suffixIndex; QVersionNumber version = QVersionNumber::fromString(string, &suffixIndex); // version is 5.4.0 // suffixIndex is 5
This function was introduced in Qt 5.10.
See also isNull().
sourcepub unsafe fn from_string_q_latin1_string(
string: impl CastInto<Ref<QLatin1String>>
) -> CppBox<QVersionNumber>
pub unsafe fn from_string_q_latin1_string( string: impl CastInto<Ref<QLatin1String>> ) -> CppBox<QVersionNumber>
This is an overloaded function.
Calls C++ function: static QVersionNumber QVersionNumber::fromString(QLatin1String string)
.
This is an overloaded function.
Constructs a QVersionNumber from a specially formatted string of non-negative decimal numbers delimited by '.'.
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.
QLatin1String string(“5.4.0-alpha”); int suffixIndex; auto version = QVersionNumber::fromString(string, &suffixIndex); // version is 5.4.0 // suffixIndex is 5
This function was introduced in Qt 5.10.
See also isNull().
sourcepub unsafe fn from_string_q_string_view(
string: impl CastInto<Ref<QStringView>>
) -> CppBox<QVersionNumber>
Available on cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn from_string_q_string_view( string: impl CastInto<Ref<QStringView>> ) -> CppBox<QVersionNumber>
cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.This is an overloaded function.
Calls C++ function: static QVersionNumber QVersionNumber::fromString(QStringView string)
.
This is an overloaded function.
Constructs a QVersionNumber from a specially formatted string of non-negative decimal numbers delimited by '.'.
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.
QString string(“5.4.0-alpha”); int suffixIndex; QVersionNumber version = QVersionNumber::fromString(string, &suffixIndex); // version is 5.4.0 // suffixIndex is 5
This function was introduced in Qt 5.10.
See also isNull().
sourcepub unsafe fn is_normalized(&self) -> bool
pub unsafe fn is_normalized(&self) -> bool
Returns true
if the version number does not contain any trailing zeros, otherwise returns false
.
Calls C++ function: bool QVersionNumber::isNormalized() const
.
Returns true
if the version number does not contain any trailing zeros, otherwise returns false
.
See also normalized().
sourcepub unsafe fn is_null(&self) -> bool
pub unsafe fn is_null(&self) -> bool
Returns true
if there are zero numerical segments, otherwise returns false
.
Calls C++ function: bool QVersionNumber::isNull() const
.
Returns true
if there are zero numerical segments, otherwise returns false
.
See also segments().
sourcepub unsafe fn is_prefix_of(
&self,
other: impl CastInto<Ref<QVersionNumber>>
) -> bool
pub unsafe fn is_prefix_of( &self, other: impl CastInto<Ref<QVersionNumber>> ) -> bool
Returns true
if the current version number is contained in the other version number, otherwise returns false
.
Calls C++ function: bool QVersionNumber::isPrefixOf(const QVersionNumber& other) const
.
Returns true
if the current version number is contained in the other version number, otherwise returns false
.
QVersionNumber v1(5, 3); QVersionNumber v2(5, 3, 1); bool value = v1.isPrefixOf(v2); // true
See also commonPrefix().
sourcepub unsafe fn major_version(&self) -> c_int
pub unsafe fn major_version(&self) -> c_int
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.
Calls C++ function: int QVersionNumber::majorVersion() const
.
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.
sourcepub unsafe fn micro_version(&self) -> c_int
pub unsafe fn micro_version(&self) -> c_int
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.
Calls C++ function: int QVersionNumber::microVersion() const
.
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.
sourcepub unsafe fn minor_version(&self) -> c_int
pub unsafe fn minor_version(&self) -> c_int
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.
Calls C++ function: int QVersionNumber::minorVersion() const
.
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.
sourcepub unsafe fn new() -> CppBox<QVersionNumber>
pub unsafe fn new() -> CppBox<QVersionNumber>
Produces a null version.
Calls C++ function: [constructor] void QVersionNumber::QVersionNumber()
.
Produces a null version.
See also isNull().
sourcepub unsafe fn from_q_vector_of_int(
seg: impl CastInto<Ref<QVectorOfInt>>
) -> CppBox<QVersionNumber>
pub unsafe fn from_q_vector_of_int( seg: impl CastInto<Ref<QVectorOfInt>> ) -> CppBox<QVersionNumber>
Constructs a version number from the list of numbers contained in seg.
Calls C++ function: [constructor] void QVersionNumber::QVersionNumber(const QVector<int>& seg)
.
Constructs a version number from the list of numbers contained in seg.
sourcepub unsafe fn from_int(maj: c_int) -> CppBox<QVersionNumber>
pub unsafe fn from_int(maj: c_int) -> CppBox<QVersionNumber>
Constructs a QVersionNumber consisting of just the major version number maj.
Calls C++ function: [constructor] void QVersionNumber::QVersionNumber(int maj)
.
Constructs a QVersionNumber consisting of just the major version number maj.
sourcepub unsafe fn from_2_int(maj: c_int, min: c_int) -> CppBox<QVersionNumber>
pub unsafe fn from_2_int(maj: c_int, min: c_int) -> CppBox<QVersionNumber>
Constructs a QVersionNumber consisting of the major and minor version numbers maj and min, respectively.
Calls C++ function: [constructor] void QVersionNumber::QVersionNumber(int maj, int min)
.
Constructs a QVersionNumber consisting of the major and minor version numbers maj and min, respectively.
sourcepub unsafe fn from_3_int(
maj: c_int,
min: c_int,
mic: c_int
) -> CppBox<QVersionNumber>
pub unsafe fn from_3_int( maj: c_int, min: c_int, mic: c_int ) -> CppBox<QVersionNumber>
Constructs a QVersionNumber consisting of the major, minor, and micro version numbers maj, min and mic, respectively.
Calls C++ function: [constructor] void QVersionNumber::QVersionNumber(int maj, int min, int mic)
.
Constructs a QVersionNumber consisting of the major, minor, and micro version numbers maj, min and mic, respectively.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QVersionNumber>>
) -> CppBox<QVersionNumber>
pub unsafe fn new_copy( other: impl CastInto<Ref<QVersionNumber>> ) -> CppBox<QVersionNumber>
The QVersionNumber class contains a version number with an arbitrary number of segments.
Calls C++ function: [constructor] void QVersionNumber::QVersionNumber(const QVersionNumber& other)
.
The QVersionNumber class contains a version number with an arbitrary number of segments.
QVersionNumber version(1, 2, 3); // 1.2.3
sourcepub unsafe fn normalized(&self) -> CppBox<QVersionNumber>
pub unsafe fn normalized(&self) -> CppBox<QVersionNumber>
Returns an equivalent version number but with all trailing zeros removed.
Calls C++ function: QVersionNumber QVersionNumber::normalized() const
.
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.
QVersionNumber v1(5, 4); QVersionNumber v2(5, 4, 0); bool equivalent = v1.normalized() == v2.normalized(); bool equal = v1 == v2; // equivalent is true // equal is false
sourcepub unsafe fn segment_at(&self, index: c_int) -> c_int
pub unsafe fn segment_at(&self, index: c_int) -> c_int
Returns the segement value at index. If the index does not exist, returns 0.
Calls C++ function: int QVersionNumber::segmentAt(int index) const
.
Returns the segement value at index. If the index does not exist, returns 0.
See also segments() and segmentCount().
sourcepub unsafe fn segment_count(&self) -> c_int
pub unsafe fn segment_count(&self) -> c_int
Returns the number of integers stored in segments().
Calls C++ function: int QVersionNumber::segmentCount() const
.
sourcepub unsafe fn segments(&self) -> CppBox<QVectorOfInt>
pub unsafe fn segments(&self) -> CppBox<QVectorOfInt>
Returns all of the numerical segments.
Calls C++ function: QVector<int> QVersionNumber::segments() const
.
Returns all of the numerical segments.
See also majorVersion(), minorVersion(), and microVersion().
sourcepub unsafe fn to_string(&self) -> CppBox<QString>
pub unsafe fn to_string(&self) -> CppBox<QString>
Returns a string with all of the segments delimited by a period (.
).
Calls C++ function: QString QVersionNumber::toString() const
.
Returns a string with all of the segments delimited by a period (.
).
See also majorVersion(), minorVersion(), microVersion(), and segments().
Trait Implementations§
source§impl CppDeletable for QVersionNumber
impl CppDeletable for QVersionNumber
source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QVersionNumber class contains a version number with an arbitrary number of segments.
Calls C++ function: [destructor] void QVersionNumber::~QVersionNumber()
.
The QVersionNumber class contains a version number with an arbitrary number of segments.
QVersionNumber version(1, 2, 3); // 1.2.3
source§impl Ge<Ref<QVersionNumber>> for QVersionNumber
impl Ge<Ref<QVersionNumber>> for QVersionNumber
source§unsafe fn ge(&self, rhs: &Ref<QVersionNumber>) -> bool
unsafe fn ge(&self, rhs: &Ref<QVersionNumber>) -> bool
Returns true
if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false
.
Calls C++ function: bool operator>=(const QVersionNumber& lhs, const QVersionNumber& rhs)
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator>=(QChar c1, QChar c2)
:
Returns true
if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false
.
source§impl Gt<Ref<QVersionNumber>> for QVersionNumber
impl Gt<Ref<QVersionNumber>> for QVersionNumber
source§impl Le<Ref<QVersionNumber>> for QVersionNumber
impl Le<Ref<QVersionNumber>> for QVersionNumber
source§unsafe fn le(&self, rhs: &Ref<QVersionNumber>) -> bool
unsafe fn le(&self, rhs: &Ref<QVersionNumber>) -> bool
Returns true
if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false
.
Calls C++ function: bool operator<=(const QVersionNumber& lhs, const QVersionNumber& rhs)
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator<=(QChar c1, QChar c2)
:
Returns true
if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false
.
source§impl Lt<Ref<QVersionNumber>> for QVersionNumber
impl Lt<Ref<QVersionNumber>> for QVersionNumber
source§impl PartialEq<Ref<QVersionNumber>> for QVersionNumber
impl PartialEq<Ref<QVersionNumber>> for QVersionNumber
source§fn eq(&self, rhs: &Ref<QVersionNumber>) -> bool
fn eq(&self, rhs: &Ref<QVersionNumber>) -> bool
Returns true
if c1 and c2 are the same Unicode character; otherwise returns false
.
Calls C++ function: bool operator==(const QVersionNumber& lhs, const QVersionNumber& rhs)
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2)
:
Returns true
if c1 and c2 are the same Unicode character; otherwise returns false
.