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.

C++ documentation:

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

source

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).

C++ documentation:

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().

source

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).

C++ documentation:

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

source

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).

C++ documentation:

The QVersionNumber class contains a version number with an arbitrary number of segments.


  QVersionNumber version(1, 2, 3);  // 1.2.3

source

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 = …).

C++ documentation:

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().

source

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).

C++ documentation:

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().

source

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 = …).

C++ documentation:

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().

source

pub 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.

This is an overloaded function.

Calls C++ function: static QVersionNumber QVersionNumber::fromString(QStringView string, int* suffixIndex = …).

C++ documentation:

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().

source

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).

C++ documentation:

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().

source

pub 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.

This is an overloaded function.

Calls C++ function: static QVersionNumber QVersionNumber::fromString(QStringView string).

C++ documentation:

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().

source

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.

C++ documentation:

Returns true if the version number does not contain any trailing zeros, otherwise returns false.

See also normalized().

source

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.

C++ documentation:

Returns true if there are zero numerical segments, otherwise returns false.

See also segments().

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

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.

See also isNull() and segmentAt().

source

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.

C++ documentation:

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.

See also isNull() and segmentAt().

source

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.

C++ documentation:

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.

See also isNull() and segmentAt().

source

pub unsafe fn new() -> CppBox<QVersionNumber>

Produces a null version.

Calls C++ function: [constructor] void QVersionNumber::QVersionNumber().

C++ documentation:

Produces a null version.

See also isNull().

source

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).

C++ documentation:

Constructs a version number from the list of numbers contained in seg.

source

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).

C++ documentation:

Constructs a QVersionNumber consisting of just the major version number maj.

source

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).

C++ documentation:

Constructs a QVersionNumber consisting of the major and minor version numbers maj and min, respectively.

source

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).

C++ documentation:

Constructs a QVersionNumber consisting of the major, minor, and micro version numbers maj, min and mic, respectively.

source

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).

C++ documentation:

The QVersionNumber class contains a version number with an arbitrary number of segments.


  QVersionNumber version(1, 2, 3);  // 1.2.3

source

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.

C++ documentation:

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

source

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.

C++ documentation:

Returns the segement value at index. If the index does not exist, returns 0.

See also segments() and segmentCount().

source

pub unsafe fn segment_count(&self) -> c_int

Returns the number of integers stored in segments().

Calls C++ function: int QVersionNumber::segmentCount() const.

C++ documentation:

Returns the number of integers stored in segments().

See also segments().

source

pub unsafe fn segments(&self) -> CppBox<QVectorOfInt>

Returns all of the numerical segments.

Calls C++ function: QVector<int> QVersionNumber::segments() const.

C++ documentation:

Returns all of the numerical segments.

See also majorVersion(), minorVersion(), and microVersion().

source

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.

C++ documentation:

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

source§

unsafe fn delete(&self)

The QVersionNumber class contains a version number with an arbitrary number of segments.

Calls C++ function: [destructor] void QVersionNumber::~QVersionNumber().

C++ documentation:

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

source§

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

source§

unsafe fn gt(&self, rhs: &Ref<QVersionNumber>) -> bool

Calls C++ function: bool operator>(const QVersionNumber& lhs, const QVersionNumber& rhs).

source§

impl Le<Ref<QVersionNumber>> for QVersionNumber

source§

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

source§

unsafe fn lt(&self, rhs: &Ref<QVersionNumber>) -> bool

Calls C++ function: bool operator<(const QVersionNumber& lhs, const QVersionNumber& rhs).

source§

impl PartialEq<Ref<QVersionNumber>> for QVersionNumber

source§

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.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.