[][src]Struct qt_core::QVersionNumber

#[repr(C)]pub struct QVersionNumber { /* fields omitted */ }

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

Methods

impl QVersionNumber[src]

pub unsafe fn common_prefix(
    v1: impl CastInto<Ref<QVersionNumber>>,
    v2: impl CastInto<Ref<QVersionNumber>>
) -> CppBox<QVersionNumber>
[src]

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

pub unsafe fn compare(
    v1: impl CastInto<Ref<QVersionNumber>>,
    v2: impl CastInto<Ref<QVersionNumber>>
) -> c_int
[src]

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

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QVersionNumber>>
) -> Ref<QVersionNumber>
[src]

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

pub unsafe fn from_string_q_string_int(
    string: impl CastInto<Ref<QString>>,
    suffix_index: *mut c_int
) -> CppBox<QVersionNumber>
[src]

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

pub unsafe fn from_string_q_string(
    string: impl CastInto<Ref<QString>>
) -> CppBox<QVersionNumber>
[src]

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

pub unsafe fn from_string_q_latin1_string_int(
    string: impl CastInto<Ref<QLatin1String>>,
    suffix_index: *mut c_int
) -> CppBox<QVersionNumber>
[src]

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

pub unsafe fn from_string_q_string_view_int(
    string: impl CastInto<Ref<QStringView>>,
    suffix_index: *mut c_int
) -> CppBox<QVersionNumber>
[src]

This is supported 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().

pub unsafe fn from_string_q_latin1_string(
    string: impl CastInto<Ref<QLatin1String>>
) -> CppBox<QVersionNumber>
[src]

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

pub unsafe fn from_string_q_string_view(
    string: impl CastInto<Ref<QStringView>>
) -> CppBox<QVersionNumber>
[src]

This is supported 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().

pub unsafe fn is_normalized(&self) -> bool[src]

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

pub unsafe fn is_null(&self) -> bool[src]

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

pub unsafe fn is_prefix_of(
    &self,
    other: impl CastInto<Ref<QVersionNumber>>
) -> bool
[src]

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

pub unsafe fn major_version(&self) -> c_int[src]

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

pub unsafe fn micro_version(&self) -> c_int[src]

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

pub unsafe fn minor_version(&self) -> c_int[src]

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

pub unsafe fn new() -> CppBox<QVersionNumber>[src]

Produces a null version.

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

C++ documentation:

Produces a null version.

See also isNull().

pub unsafe fn from_q_vector_of_int(
    seg: impl CastInto<Ref<QVectorOfInt>>
) -> CppBox<QVersionNumber>
[src]

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.

pub unsafe fn from_int(maj: c_int) -> CppBox<QVersionNumber>[src]

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.

pub unsafe fn from_2_int(maj: c_int, min: c_int) -> CppBox<QVersionNumber>[src]

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.

pub unsafe fn from_3_int(
    maj: c_int,
    min: c_int,
    mic: c_int
) -> CppBox<QVersionNumber>
[src]

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.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QVersionNumber>>
) -> CppBox<QVersionNumber>
[src]

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

pub unsafe fn normalized(&self) -> CppBox<QVersionNumber>[src]

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

pub unsafe fn segment_at(&self, index: c_int) -> c_int[src]

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

pub unsafe fn segment_count(&self) -> c_int[src]

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

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

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

pub unsafe fn to_string(&self) -> CppBox<QString>[src]

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

impl CppDeletable for QVersionNumber[src]

unsafe fn delete(&self)[src]

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

impl Ge<Ref<QVersionNumber>> for QVersionNumber[src]

unsafe fn ge(&self, rhs: &Ref<QVersionNumber>) -> bool[src]

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.

impl Gt<Ref<QVersionNumber>> for QVersionNumber[src]

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

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

impl Le<Ref<QVersionNumber>> for QVersionNumber[src]

unsafe fn le(&self, rhs: &Ref<QVersionNumber>) -> bool[src]

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.

impl Lt<Ref<QVersionNumber>> for QVersionNumber[src]

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

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

impl PartialEq<Ref<QVersionNumber>> for QVersionNumber[src]

fn eq(&self, rhs: &Ref<QVersionNumber>) -> bool[src]

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.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.