[][src]Struct qt_core::QLatin1String

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

The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.

C++ class: QLatin1String.

C++ documentation:

The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.

Many of QString's member functions are overloaded to accept const char * instead of QString. This includes the copy constructor, the assignment operator, the comparison operators, and various other functions such as insert(), replace(), and indexOf(). These functions are usually optimized to avoid constructing a QString object for the const char * data. For example, assuming str is a QString,

if (str == "auto" || str == "extern" || str == "static" || str == "register") { ... }

is much faster than

if (str == QString("auto") || str == QString("extern") || str == QString("static") || str == QString("register")) { ... }

because it doesn't construct four temporary QString objects and make a deep copy of the character data.

Applications that define QT_NO_CAST_FROM_ASCII (as explained in the QString documentation) don't have access to QString's const char * API. To provide an efficient way of specifying constant Latin-1 strings, Qt provides the QLatin1String, which is just a very thin wrapper around a const char *. Using QLatin1String, the example code above becomes

if (str == QLatin1String("auto") || str == QLatin1String("extern") || str == QLatin1String("static") || str == QLatin1String("register") { ... }

This is a bit longer to type, but it provides exactly the same benefits as the first version of the code, and is faster than converting the Latin-1 strings using QString::fromLatin1().

Thanks to the QString(QLatin1String) constructor, QLatin1String can be used everywhere a QString is expected. For example:

QLabel *label = new QLabel(QLatin1String("MOD"), this);

Note: If the function you're calling with a QLatin1String argument isn't actually overloaded to take QLatin1String, the implicit conversion to QString will trigger a memory allocation, which is usually what you want to avoid by using QLatin1String in the first place. In those cases, using QStringLiteral may be the better option.

Methods

impl QLatin1String[src]

pub unsafe fn at(&self, i: c_int) -> CppBox<QLatin1Char>[src]

Returns the character at position pos in this object.

Calls C++ function: QLatin1Char QLatin1String::at(int i) const.

C++ documentation:

Returns the character at position pos in this object.

Note: This function performs no error checking. The behavior is undefined when pos < 0 or pos >= size().

This function was introduced in Qt 5.8.

See also operator[]().

pub unsafe fn back(&self) -> CppBox<QLatin1Char>[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.

Returns the last character in the string. Same as at(size() - 1).

Calls C++ function: QLatin1Char QLatin1String::back() const.

C++ documentation:

Returns the last character in the string. Same as at(size() - 1).

This function is provided for STL compatibility.

Warning: Calling this function on an empty string constitutes undefined behavior.

This function was introduced in Qt 5.10.

See also front(), at(), and operator[]().

pub unsafe fn begin(&self) -> *const c_char[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.

Returns a const STL-style iterator pointing to the first character in the string.

Calls C++ function: const char* QLatin1String::begin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first character in the string.

This function is provided for STL compatibility.

This function was introduced in Qt 5.10.

See also end(), cbegin(), rbegin(), and data().

pub unsafe fn cbegin(&self) -> *const c_char[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.

Same as begin().

Calls C++ function: const char* QLatin1String::cbegin() const.

C++ documentation:

Same as begin().

This function is provided for STL compatibility.

This function was introduced in Qt 5.10.

See also cend(), begin(), crbegin(), and data().

pub unsafe fn cend(&self) -> *const c_char[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.

Same as end().

Calls C++ function: const char* QLatin1String::cend() const.

C++ documentation:

Same as end().

This function is provided for STL compatibility.

This function was introduced in Qt 5.10.

See also cbegin(), end(), and crend().

pub unsafe fn chop(&self, n: c_int)[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.

Truncates this string by length characters.

Calls C++ function: void QLatin1String::chop(int n).

C++ documentation:

Truncates this string by length characters.

Same as *this = left(size() - length).

Note: The behavior is undefined when length < 0 or length > size().

This function was introduced in Qt 5.10.

See also mid(), left(), right(), chopped(), and truncate().

pub unsafe fn chopped(&self, n: c_int) -> CppBox<QLatin1String>[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.

Returns the substring of length size() - length starting at the beginning of this object.

Calls C++ function: QLatin1String QLatin1String::chopped(int n) const.

C++ documentation:

Returns the substring of length size() - length starting at the beginning of this object.

Same as left(size() - length).

Note: The behavior is undefined when length < 0 or length > size().

This function was introduced in Qt 5.10.

See also mid(), left(), right(), chop(), and truncate().

pub unsafe fn contains_q_string_view_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    cs: CaseSensitivity
) -> bool
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: bool QLatin1String::contains(QStringView s, Qt::CaseSensitivity cs = …) const.

pub unsafe fn contains_q_latin1_string_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    cs: CaseSensitivity
) -> bool
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: bool QLatin1String::contains(QLatin1String s, Qt::CaseSensitivity cs = …) const.

pub unsafe fn contains_q_char_case_sensitivity(
    &self,
    c: impl CastInto<Ref<QChar>>,
    cs: CaseSensitivity
) -> bool
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: bool QLatin1String::contains(QChar c, Qt::CaseSensitivity cs = …) const.

pub unsafe fn contains_q_string_view(
    &self,
    s: impl CastInto<Ref<QStringView>>
) -> bool
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: bool QLatin1String::contains(QStringView s) const.

pub unsafe fn contains_q_latin1_string(
    &self,
    s: impl CastInto<Ref<QLatin1String>>
) -> bool
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: bool QLatin1String::contains(QLatin1String s) const.

pub unsafe fn contains_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: bool QLatin1String::contains(QChar c) const.

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

The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.

Calls C++ function: QLatin1String& QLatin1String::operator=(const QLatin1String& other).

C++ documentation:

The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.

Many of QString's member functions are overloaded to accept const char * instead of QString. This includes the copy constructor, the assignment operator, the comparison operators, and various other functions such as insert(), replace(), and indexOf(). These functions are usually optimized to avoid constructing a QString object for the const char * data. For example, assuming str is a QString,

if (str == "auto" || str == "extern" || str == "static" || str == "register") { ... }

is much faster than

if (str == QString("auto") || str == QString("extern") || str == QString("static") || str == QString("register")) { ... }

because it doesn't construct four temporary QString objects and make a deep copy of the character data.

Applications that define QT_NO_CAST_FROM_ASCII (as explained in the QString documentation) don't have access to QString's const char * API. To provide an efficient way of specifying constant Latin-1 strings, Qt provides the QLatin1String, which is just a very thin wrapper around a const char *. Using QLatin1String, the example code above becomes

if (str == QLatin1String("auto") || str == QLatin1String("extern") || str == QLatin1String("static") || str == QLatin1String("register") { ... }

This is a bit longer to type, but it provides exactly the same benefits as the first version of the code, and is faster than converting the Latin-1 strings using QString::fromLatin1().

Thanks to the QString(QLatin1String) constructor, QLatin1String can be used everywhere a QString is expected. For example:

QLabel *label = new QLabel(QLatin1String("MOD"), this);

Note: If the function you're calling with a QLatin1String argument isn't actually overloaded to take QLatin1String, the implicit conversion to QString will trigger a memory allocation, which is usually what you want to avoid by using QLatin1String in the first place. In those cases, using QStringLiteral may be the better option.

pub unsafe fn data(&self) -> *const c_char[src]

Returns the Latin-1 string stored in this object.

Calls C++ function: const char* QLatin1String::data() const.

C++ documentation:

Returns the Latin-1 string stored in this object.

pub unsafe fn end(&self) -> *const c_char[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.

Returns a const STL-style iterator pointing to the imaginary character after the last character in the list.

Calls C++ function: const char* QLatin1String::end() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary character after the last character in the list.

This function is provided for STL compatibility.

This function was introduced in Qt 5.10.

See also begin(), cend(), and rend().

pub unsafe fn ends_with_q_string_view_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    cs: CaseSensitivity
) -> bool
[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.

Calls C++ function: bool QLatin1String::endsWith(QStringView s, Qt::CaseSensitivity cs = …) const.

pub unsafe fn ends_with_q_latin1_string_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    cs: CaseSensitivity
) -> bool
[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.

Calls C++ function: bool QLatin1String::endsWith(QLatin1String s, Qt::CaseSensitivity cs = …) const.

pub unsafe fn ends_with_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool[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.

Calls C++ function: bool QLatin1String::endsWith(QChar c) const.

pub unsafe fn ends_with_q_char_case_sensitivity(
    &self,
    c: impl CastInto<Ref<QChar>>,
    cs: CaseSensitivity
) -> bool
[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.

Calls C++ function: bool QLatin1String::endsWith(QChar c, Qt::CaseSensitivity cs) const.

pub unsafe fn ends_with_q_string_view(
    &self,
    s: impl CastInto<Ref<QStringView>>
) -> bool
[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.

Calls C++ function: bool QLatin1String::endsWith(QStringView s) const.

pub unsafe fn ends_with_q_latin1_string(
    &self,
    s: impl CastInto<Ref<QLatin1String>>
) -> bool
[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.

Calls C++ function: bool QLatin1String::endsWith(QLatin1String s) const.

pub unsafe fn front(&self) -> CppBox<QLatin1Char>[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.

Returns the first character in the string. Same as at(0).

Calls C++ function: QLatin1Char QLatin1String::front() const.

C++ documentation:

Returns the first character in the string. Same as at(0).

This function is provided for STL compatibility.

Warning: Calling this function on an empty string constitutes undefined behavior.

This function was introduced in Qt 5.10.

See also back(), at(), and operator[]().

pub unsafe fn index(&self, i: c_int) -> CppBox<QLatin1Char>[src]

Returns the character at position pos in this object.

Calls C++ function: QLatin1Char QLatin1String::operator[](int i) const.

C++ documentation:

Returns the character at position pos in this object.

Note: This function performs no error checking. The behavior is undefined when pos < 0 or pos >= size().

This function was introduced in Qt 5.8.

See also at().

pub unsafe fn index_of_q_string_view_int_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    from: c_int,
    cs: CaseSensitivity
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QStringView s, int from = …, Qt::CaseSensitivity cs = …) const.

pub unsafe fn index_of_q_latin1_string_int_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    from: c_int,
    cs: CaseSensitivity
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QLatin1String s, int from = …, Qt::CaseSensitivity cs = …) const.

pub unsafe fn index_of_q_char_int_case_sensitivity(
    &self,
    c: impl CastInto<Ref<QChar>>,
    from: c_int,
    cs: CaseSensitivity
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QChar c, int from = …, Qt::CaseSensitivity cs = …) const.

pub unsafe fn index_of_q_string_view_int(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    from: c_int
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QStringView s, int from = …) const.

pub unsafe fn index_of_q_string_view(
    &self,
    s: impl CastInto<Ref<QStringView>>
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QStringView s) const.

pub unsafe fn index_of_q_latin1_string_int(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    from: c_int
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QLatin1String s, int from = …) const.

pub unsafe fn index_of_q_latin1_string(
    &self,
    s: impl CastInto<Ref<QLatin1String>>
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QLatin1String s) const.

pub unsafe fn index_of_q_char_int(
    &self,
    c: impl CastInto<Ref<QChar>>,
    from: c_int
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QChar c, int from = …) const.

pub unsafe fn index_of_q_char(&self, c: impl CastInto<Ref<QChar>>) -> c_int[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::indexOf(QChar c) const.

pub unsafe fn is_empty(&self) -> bool[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.

Returns whether the Latin-1 string stored in this object is empty (size() == 0) or not.

Calls C++ function: bool QLatin1String::isEmpty() const.

C++ documentation:

Returns whether the Latin-1 string stored in this object is empty (size() == 0) or not.

This function was introduced in Qt 5.10.

See also isNull() and size().

pub unsafe fn is_null(&self) -> bool[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.

Returns whether the Latin-1 string stored in this object is null (data() == nullptr) or not.

Calls C++ function: bool QLatin1String::isNull() const.

C++ documentation:

Returns whether the Latin-1 string stored in this object is null (data() == nullptr) or not.

This function was introduced in Qt 5.10.

See also isEmpty() and data().

pub unsafe fn last_index_of_q_string_view_int_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    from: c_int,
    cs: CaseSensitivity
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QStringView s, int from = …, Qt::CaseSensitivity cs = …) const.

pub unsafe fn last_index_of_q_latin1_string_int_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    from: c_int,
    cs: CaseSensitivity
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QLatin1String s, int from = …, Qt::CaseSensitivity cs = …) const.

pub unsafe fn last_index_of_q_char_int_case_sensitivity(
    &self,
    c: impl CastInto<Ref<QChar>>,
    from: c_int,
    cs: CaseSensitivity
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QChar c, int from = …, Qt::CaseSensitivity cs = …) const.

pub unsafe fn last_index_of_q_string_view_int(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    from: c_int
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QStringView s, int from = …) const.

pub unsafe fn last_index_of_q_string_view(
    &self,
    s: impl CastInto<Ref<QStringView>>
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QStringView s) const.

pub unsafe fn last_index_of_q_latin1_string_int(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    from: c_int
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QLatin1String s, int from = …) const.

pub unsafe fn last_index_of_q_latin1_string(
    &self,
    s: impl CastInto<Ref<QLatin1String>>
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QLatin1String s) const.

pub unsafe fn last_index_of_q_char_int(
    &self,
    c: impl CastInto<Ref<QChar>>,
    from: c_int
) -> c_int
[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QChar c, int from = …) const.

pub unsafe fn last_index_of_q_char(&self, c: impl CastInto<Ref<QChar>>) -> c_int[src]

This is supported on cpp_lib_version="5.14.0" only.

Calls C++ function: int QLatin1String::lastIndexOf(QChar c) const.

pub unsafe fn latin1(&self) -> *const c_char[src]

Returns the Latin-1 string stored in this object.

Calls C++ function: const char* QLatin1String::latin1() const.

C++ documentation:

Returns the Latin-1 string stored in this object.

pub unsafe fn left(&self, n: c_int) -> CppBox<QLatin1String>[src]

Returns the substring of length length starting at position 0 in this object.

Calls C++ function: QLatin1String QLatin1String::left(int n) const.

C++ documentation:

Returns the substring of length length starting at position 0 in this object.

Note: This function performs no error checking. The behavior is undefined when length < 0 or length > size().

This function was introduced in Qt 5.8.

See also mid() and right().

pub unsafe fn mid_1a(&self, pos: c_int) -> CppBox<QLatin1String>[src]

Returns the substring starting at position start in this object, and extending to the end of the string.

Calls C++ function: QLatin1String QLatin1String::mid(int pos) const.

C++ documentation:

Returns the substring starting at position start in this object, and extending to the end of the string.

Note: This function performs no error checking. The behavior is undefined when start < 0 or start > size().

This function was introduced in Qt 5.8.

See also left() and right().

pub unsafe fn mid_2a(&self, pos: c_int, n: c_int) -> CppBox<QLatin1String>[src]

This is an overloaded function.

Calls C++ function: QLatin1String QLatin1String::mid(int pos, int n) const.

C++ documentation:

This is an overloaded function.

Returns the substring of length length starting at position start in this object.

Note: This function performs no error checking. The behavior is undefined when start < 0, length < 0, or start + length > size().

This function was introduced in Qt 5.8.

See also left() and right().

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

Constructs a QLatin1String object that stores a nullptr.

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

C++ documentation:

Constructs a QLatin1String object that stores a nullptr.

This function was introduced in Qt 5.6.

pub unsafe fn from_char(s: *const c_char) -> CppBox<QLatin1String>[src]

Constructs a QLatin1String object that stores str.

Calls C++ function: [constructor] void QLatin1String::QLatin1String(const char* s).

C++ documentation:

Constructs a QLatin1String object that stores str.

The string data is not copied. The caller must be able to guarantee that str will not be deleted or modified as long as the QLatin1String object exists.

See also latin1().

pub unsafe fn from_char_int(
    s: *const c_char,
    sz: c_int
) -> CppBox<QLatin1String>
[src]

Constructs a QLatin1String object that stores str with size.

Calls C++ function: [constructor] void QLatin1String::QLatin1String(const char* s, int sz).

C++ documentation:

Constructs a QLatin1String object that stores str with size.

The string data is not copied. The caller must be able to guarantee that str will not be deleted or modified as long as the QLatin1String object exists.

See also latin1().

pub unsafe fn from_q_byte_array(
    s: impl CastInto<Ref<QByteArray>>
) -> CppBox<QLatin1String>
[src]

Constructs a QLatin1String object that stores str.

Calls C++ function: [constructor] void QLatin1String::QLatin1String(const QByteArray& s).

C++ documentation:

Constructs a QLatin1String object that stores str.

The string data is not copied. The caller must be able to guarantee that str will not be deleted or modified as long as the QLatin1String object exists.

See also latin1().

pub unsafe fn from_2_char(
    f: *const c_char,
    l: *const c_char
) -> CppBox<QLatin1String>
[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.

Constructs a QLatin1String object that stores first with length (last - first).

Calls C++ function: [constructor] void QLatin1String::QLatin1String(const char* f, const char* l).

C++ documentation:

Constructs a QLatin1String object that stores first with length (last - first).

The range [first,last) must remain valid for the lifetime of this Latin-1 string object.

Passing nullptr as first is safe if last is nullptr, too, and results in a null Latin-1 string.

The behavior is undefined if last precedes first, first is nullptr and last is not, or if last - first > INT_MAX.

This function was introduced in Qt 5.10.

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

The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.

Calls C++ function: [constructor] void QLatin1String::QLatin1String(const QLatin1String& other).

C++ documentation:

The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.

Many of QString's member functions are overloaded to accept const char * instead of QString. This includes the copy constructor, the assignment operator, the comparison operators, and various other functions such as insert(), replace(), and indexOf(). These functions are usually optimized to avoid constructing a QString object for the const char * data. For example, assuming str is a QString,

if (str == "auto" || str == "extern" || str == "static" || str == "register") { ... }

is much faster than

if (str == QString("auto") || str == QString("extern") || str == QString("static") || str == QString("register")) { ... }

because it doesn't construct four temporary QString objects and make a deep copy of the character data.

Applications that define QT_NO_CAST_FROM_ASCII (as explained in the QString documentation) don't have access to QString's const char * API. To provide an efficient way of specifying constant Latin-1 strings, Qt provides the QLatin1String, which is just a very thin wrapper around a const char *. Using QLatin1String, the example code above becomes

if (str == QLatin1String("auto") || str == QLatin1String("extern") || str == QLatin1String("static") || str == QLatin1String("register") { ... }

This is a bit longer to type, but it provides exactly the same benefits as the first version of the code, and is faster than converting the Latin-1 strings using QString::fromLatin1().

Thanks to the QString(QLatin1String) constructor, QLatin1String can be used everywhere a QString is expected. For example:

QLabel *label = new QLabel(QLatin1String("MOD"), this);

Note: If the function you're calling with a QLatin1String argument isn't actually overloaded to take QLatin1String, the implicit conversion to QString will trigger a memory allocation, which is usually what you want to avoid by using QLatin1String in the first place. In those cases, using QStringLiteral may be the better option.

pub unsafe fn right(&self, n: c_int) -> CppBox<QLatin1String>[src]

Returns the substring of length length starting at position size() - length in this object.

Calls C++ function: QLatin1String QLatin1String::right(int n) const.

C++ documentation:

Returns the substring of length length starting at position size() - length in this object.

Note: This function performs no error checking. The behavior is undefined when length < 0 or length > size().

This function was introduced in Qt 5.8.

See also mid() and left().

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

Returns the size of the Latin-1 string stored in this object.

Calls C++ function: int QLatin1String::size() const.

C++ documentation:

Returns the size of the Latin-1 string stored in this object.

pub unsafe fn starts_with_q_string_view_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    cs: CaseSensitivity
) -> bool
[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.

Calls C++ function: bool QLatin1String::startsWith(QStringView s, Qt::CaseSensitivity cs = …) const.

pub unsafe fn starts_with_q_latin1_string_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    cs: CaseSensitivity
) -> bool
[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.

Calls C++ function: bool QLatin1String::startsWith(QLatin1String s, Qt::CaseSensitivity cs = …) const.

pub unsafe fn starts_with_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool[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.

Calls C++ function: bool QLatin1String::startsWith(QChar c) const.

pub unsafe fn starts_with_q_char_case_sensitivity(
    &self,
    c: impl CastInto<Ref<QChar>>,
    cs: CaseSensitivity
) -> bool
[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.

Calls C++ function: bool QLatin1String::startsWith(QChar c, Qt::CaseSensitivity cs) const.

pub unsafe fn starts_with_q_string_view(
    &self,
    s: impl CastInto<Ref<QStringView>>
) -> bool
[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.

Calls C++ function: bool QLatin1String::startsWith(QStringView s) const.

pub unsafe fn starts_with_q_latin1_string(
    &self,
    s: impl CastInto<Ref<QLatin1String>>
) -> bool
[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.

Calls C++ function: bool QLatin1String::startsWith(QLatin1String s) const.

pub unsafe fn trimmed(&self) -> CppBox<QLatin1String>[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.

Strips leading and trailing whitespace and returns the result.

Calls C++ function: QLatin1String QLatin1String::trimmed() const.

C++ documentation:

Strips leading and trailing whitespace and returns the result.

Whitespace means any character for which QChar::isSpace() returns true. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.

This function was introduced in Qt 5.10.

pub unsafe fn truncate(&self, n: c_int)[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.

Truncates this string to length length.

Calls C++ function: void QLatin1String::truncate(int n).

C++ documentation:

Truncates this string to length length.

Same as *this = left(length).

Note: The behavior is undefined when length < 0 or length > size().

This function was introduced in Qt 5.10.

See also mid(), left(), right(), chopped(), and chop().

Trait Implementations

impl<'_> Add<Ref<QStringRef>> for &'_ QLatin1String[src]

type Output = CppBox<QString>

The resulting type after applying the + operator.

fn add(self, s2: Ref<QStringRef>) -> CppBox<QString>[src]

Calls C++ function: QString operator+(QLatin1String s1, const QStringRef& s2).

impl Begin for QLatin1String[src]

type Output = *const c_char

Output type.

unsafe fn begin(&self) -> *const c_char[src]

Returns a const STL-style iterator pointing to the first character in the string.

Calls C++ function: const char* QLatin1String::begin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first character in the string.

This function is provided for STL compatibility.

This function was introduced in Qt 5.10.

See also end(), cbegin(), rbegin(), and data().

impl CppDeletable for QLatin1String[src]

unsafe fn delete(&self)[src]

The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.

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

C++ documentation:

The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.

Many of QString's member functions are overloaded to accept const char * instead of QString. This includes the copy constructor, the assignment operator, the comparison operators, and various other functions such as insert(), replace(), and indexOf(). These functions are usually optimized to avoid constructing a QString object for the const char * data. For example, assuming str is a QString,

if (str == "auto" || str == "extern" || str == "static" || str == "register") { ... }

is much faster than

if (str == QString("auto") || str == QString("extern") || str == QString("static") || str == QString("register")) { ... }

because it doesn't construct four temporary QString objects and make a deep copy of the character data.

Applications that define QT_NO_CAST_FROM_ASCII (as explained in the QString documentation) don't have access to QString's const char * API. To provide an efficient way of specifying constant Latin-1 strings, Qt provides the QLatin1String, which is just a very thin wrapper around a const char *. Using QLatin1String, the example code above becomes

if (str == QLatin1String("auto") || str == QLatin1String("extern") || str == QLatin1String("static") || str == QLatin1String("register") { ... }

This is a bit longer to type, but it provides exactly the same benefits as the first version of the code, and is faster than converting the Latin-1 strings using QString::fromLatin1().

Thanks to the QString(QLatin1String) constructor, QLatin1String can be used everywhere a QString is expected. For example:

QLabel *label = new QLabel(QLatin1String("MOD"), this);

Note: If the function you're calling with a QLatin1String argument isn't actually overloaded to take QLatin1String, the implicit conversion to QString will trigger a memory allocation, which is usually what you want to avoid by using QLatin1String in the first place. In those cases, using QStringLiteral may be the better option.

impl Data for QLatin1String[src]

type Output = *const c_char

Return type of data() function.

unsafe fn data(&self) -> *const c_char[src]

Returns the Latin-1 string stored in this object.

Calls C++ function: const char* QLatin1String::data() const.

C++ documentation:

Returns the Latin-1 string stored in this object.

impl End for QLatin1String[src]

type Output = *const c_char

Output type.

unsafe fn end(&self) -> *const c_char[src]

Returns a const STL-style iterator pointing to the imaginary character after the last character in the list.

Calls C++ function: const char* QLatin1String::end() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary character after the last character in the list.

This function is provided for STL compatibility.

This function was introduced in Qt 5.10.

See also begin(), cend(), and rend().

impl Ge<*const i8> for QLatin1String[src]

unsafe fn ge(&self, s: &*const c_char) -> bool[src]

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator>=(const char* s) const.

C++ documentation:

This is an overloaded function.

The other const char pointer is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 4.3.

impl Ge<Ref<QByteArray>> for QLatin1String[src]

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

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator>=(const QByteArray& s) const.

C++ documentation:

This is an overloaded function.

The other array is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 5.0.

impl Ge<Ref<QChar>> for QLatin1String[src]

unsafe fn ge(&self, rhs: &Ref<QChar>) -> 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>=(QLatin1String lhs, QChar 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 Ge<Ref<QLatin1String>> for QLatin1String[src]

unsafe fn ge(&self, s2: &Ref<QLatin1String>) -> 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>=(QLatin1String s1, QLatin1String s2).

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 Ge<Ref<QString>> for QLatin1String[src]

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

Returns true if this string is lexically greater than or equal to string other; otherwise returns false.

Calls C++ function: bool QLatin1String::operator>=(const QString& s) const.

C++ documentation:

Returns true if this string is lexically greater than or equal to string other; otherwise returns false.

The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings with QString::localeAwareCompare().

impl Ge<Ref<QStringRef>> for QLatin1String[src]

unsafe fn ge(&self, rhs: &Ref<QStringRef>) -> 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>=(QLatin1String lhs, const QStringRef& 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 Ge<Ref<QStringView>> for QLatin1String[src]

unsafe fn ge(&self, rhs: &Ref<QStringView>) -> 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>=(QLatin1String lhs, QStringView 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<*const i8> for QLatin1String[src]

unsafe fn gt(&self, s: &*const c_char) -> bool[src]

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator>(const char* s) const.

C++ documentation:

This is an overloaded function.

The other const char pointer is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 4.3.

impl Gt<Ref<QByteArray>> for QLatin1String[src]

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

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator>(const QByteArray& s) const.

C++ documentation:

This is an overloaded function.

The other const char pointer is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 5.0.

impl Gt<Ref<QChar>> for QLatin1String[src]

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

Calls C++ function: bool operator>(QLatin1String lhs, QChar rhs).

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

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

Calls C++ function: bool operator>(QLatin1String s1, QLatin1String s2).

impl Gt<Ref<QString>> for QLatin1String[src]

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

Returns true if this string is lexically greater than string other; otherwise returns false.

Calls C++ function: bool QLatin1String::operator>(const QString& s) const.

C++ documentation:

Returns true if this string is lexically greater than string other; otherwise returns false.

The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings with QString::localeAwareCompare().

impl Gt<Ref<QStringRef>> for QLatin1String[src]

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

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

impl Gt<Ref<QStringView>> for QLatin1String[src]

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

Calls C++ function: bool operator>(QLatin1String lhs, QStringView rhs).

impl Le<*const i8> for QLatin1String[src]

unsafe fn le(&self, s: &*const c_char) -> bool[src]

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator<=(const char* s) const.

C++ documentation:

This is an overloaded function.

The other const char pointer is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 4.3.

impl Le<Ref<QByteArray>> for QLatin1String[src]

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

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator<=(const QByteArray& s) const.

C++ documentation:

This is an overloaded function.

The other array is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 5.0.

impl Le<Ref<QChar>> for QLatin1String[src]

unsafe fn le(&self, rhs: &Ref<QChar>) -> 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<=(QLatin1String lhs, QChar 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 Le<Ref<QLatin1String>> for QLatin1String[src]

unsafe fn le(&self, s2: &Ref<QLatin1String>) -> 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<=(QLatin1String s1, QLatin1String s2).

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 Le<Ref<QString>> for QLatin1String[src]

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

Returns true if this string is lexically less than or equal to string other; otherwise returns false.

Calls C++ function: bool QLatin1String::operator<=(const QString& s) const.

C++ documentation:

Returns true if this string is lexically less than or equal to string other; otherwise returns false.

The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings with QString::localeAwareCompare().

impl Le<Ref<QStringRef>> for QLatin1String[src]

unsafe fn le(&self, rhs: &Ref<QStringRef>) -> 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<=(QLatin1String lhs, const QStringRef& 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 Le<Ref<QStringView>> for QLatin1String[src]

unsafe fn le(&self, rhs: &Ref<QStringView>) -> 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<=(QLatin1String lhs, QStringView 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<*const i8> for QLatin1String[src]

unsafe fn lt(&self, s: &*const c_char) -> bool[src]

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator<(const char* s) const.

C++ documentation:

This is an overloaded function.

The other const char pointer is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 4.3.

impl Lt<Ref<QByteArray>> for QLatin1String[src]

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

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator<(const QByteArray& s) const.

C++ documentation:

This is an overloaded function.

The other const char pointer is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 5.0.

impl Lt<Ref<QChar>> for QLatin1String[src]

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

Calls C++ function: bool operator<(QLatin1String lhs, QChar rhs).

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

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

Calls C++ function: bool operator<(QLatin1String s1, QLatin1String s2).

impl Lt<Ref<QString>> for QLatin1String[src]

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

Returns true if this string is lexically less than the other string; otherwise returns false.

Calls C++ function: bool QLatin1String::operator<(const QString& s) const.

C++ documentation:

Returns true if this string is lexically less than the other string; otherwise returns false.

The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the QString::localeAwareCompare() function.

impl Lt<Ref<QStringRef>> for QLatin1String[src]

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

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

impl Lt<Ref<QStringView>> for QLatin1String[src]

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

Calls C++ function: bool operator<(QLatin1String lhs, QStringView rhs).

impl PartialEq<*const i8> for QLatin1String[src]

fn eq(&self, s: &*const c_char) -> bool[src]

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator==(const char* s) const.

C++ documentation:

This is an overloaded function.

The other const char pointer is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 4.3.

impl PartialEq<Ref<QByteArray>> for QLatin1String[src]

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

This is an overloaded function.

Calls C++ function: bool QLatin1String::operator==(const QByteArray& s) const.

C++ documentation:

This is an overloaded function.

The other byte array is converted to a QString using the QString::fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

This function was introduced in Qt 5.0.

impl PartialEq<Ref<QChar>> for QLatin1String[src]

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

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(QLatin1String lhs, QChar 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.

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

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

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(QLatin1String s1, QLatin1String s2).

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.

impl PartialEq<Ref<QString>> for QLatin1String[src]

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

Returns true if this string is equal to string other; otherwise returns false.

Calls C++ function: bool QLatin1String::operator==(const QString& s) const.

C++ documentation:

Returns true if this string is equal to string other; otherwise returns false.

The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings with QString::localeAwareCompare().

impl PartialEq<Ref<QStringRef>> for QLatin1String[src]

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

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(QLatin1String lhs, const QStringRef& 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.

impl PartialEq<Ref<QStringView>> for QLatin1String[src]

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

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(QLatin1String lhs, QStringView 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.

impl Size for QLatin1String[src]

unsafe fn size(&self) -> usize[src]

Returns the size of the Latin-1 string stored in this object.

Calls C++ function: int QLatin1String::size() const.

C++ documentation:

Returns the size of the Latin-1 string stored in this object.

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.