Struct qt_core::QLatin1String
source · #[repr(C)]pub struct QLatin1String { /* private fields */ }
Expand description
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
C++ class: QLatin1String
.
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:
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.
Implementations§
source§impl QLatin1String
impl QLatin1String
sourcepub unsafe fn at(&self, i: c_int) -> CppBox<QLatin1Char>
pub unsafe fn at(&self, i: c_int) -> CppBox<QLatin1Char>
Returns the character at position pos in this object.
Calls C++ function: QLatin1Char QLatin1String::at(int i) const
.
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[]().
sourcepub unsafe fn back(&self) -> CppBox<QLatin1Char>
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 back(&self) -> CppBox<QLatin1Char>
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
.
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[]().
sourcepub unsafe fn begin(&self) -> *const c_char
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 begin(&self) -> *const c_char
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
.
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.
sourcepub unsafe fn cbegin(&self) -> *const c_char
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 cbegin(&self) -> *const c_char
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.sourcepub unsafe fn cend(&self) -> *const c_char
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 cend(&self) -> *const c_char
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.sourcepub unsafe fn chop(&self, n: c_int)
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 chop(&self, n: c_int)
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)
.
sourcepub unsafe fn chopped(&self, n: c_int) -> CppBox<QLatin1String>
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 chopped(&self, n: c_int) -> CppBox<QLatin1String>
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
.
sourcepub unsafe fn contains_q_string_view_case_sensitivity(
&self,
s: impl CastInto<Ref<QStringView>>,
cs: CaseSensitivity
) -> bool
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn contains_q_string_view_case_sensitivity( &self, s: impl CastInto<Ref<QStringView>>, cs: CaseSensitivity ) -> bool
cpp_lib_version="5.14.0"
only.Calls C++ function: bool QLatin1String::contains(QStringView s, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn contains_q_latin1_string_case_sensitivity(
&self,
s: impl CastInto<Ref<QLatin1String>>,
cs: CaseSensitivity
) -> bool
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn contains_q_latin1_string_case_sensitivity( &self, s: impl CastInto<Ref<QLatin1String>>, cs: CaseSensitivity ) -> bool
cpp_lib_version="5.14.0"
only.Calls C++ function: bool QLatin1String::contains(QLatin1String s, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn contains_q_char_case_sensitivity(
&self,
c: impl CastInto<Ref<QChar>>,
cs: CaseSensitivity
) -> bool
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn contains_q_char_case_sensitivity( &self, c: impl CastInto<Ref<QChar>>, cs: CaseSensitivity ) -> bool
cpp_lib_version="5.14.0"
only.Calls C++ function: bool QLatin1String::contains(QChar c, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn contains_q_string_view(
&self,
s: impl CastInto<Ref<QStringView>>
) -> bool
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn contains_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> bool
cpp_lib_version="5.14.0"
only.Calls C++ function: bool QLatin1String::contains(QStringView s) const
.
sourcepub unsafe fn contains_q_latin1_string(
&self,
s: impl CastInto<Ref<QLatin1String>>
) -> bool
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn contains_q_latin1_string( &self, s: impl CastInto<Ref<QLatin1String>> ) -> bool
cpp_lib_version="5.14.0"
only.Calls C++ function: bool QLatin1String::contains(QLatin1String s) const
.
sourcepub unsafe fn contains_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn contains_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool
cpp_lib_version="5.14.0"
only.Calls C++ function: bool QLatin1String::contains(QChar c) const
.
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QLatin1String>>
) -> Ref<QLatin1String>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QLatin1String>> ) -> Ref<QLatin1String>
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)
.
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:
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.
sourcepub unsafe fn data(&self) -> *const c_char
pub unsafe fn data(&self) -> *const c_char
Returns the Latin-1 string stored in this object.
Calls C++ function: const char* QLatin1String::data() const
.
Returns the Latin-1 string stored in this object.
sourcepub unsafe fn end(&self) -> *const c_char
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 end(&self) -> *const c_char
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
.
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.
sourcepub unsafe fn ends_with_q_string_view_case_sensitivity(
&self,
s: impl CastInto<Ref<QStringView>>,
cs: CaseSensitivity
) -> bool
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 ends_with_q_string_view_case_sensitivity( &self, s: impl CastInto<Ref<QStringView>>, cs: CaseSensitivity ) -> bool
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
.
sourcepub unsafe fn ends_with_q_latin1_string_case_sensitivity(
&self,
s: impl CastInto<Ref<QLatin1String>>,
cs: CaseSensitivity
) -> bool
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 ends_with_q_latin1_string_case_sensitivity( &self, s: impl CastInto<Ref<QLatin1String>>, cs: CaseSensitivity ) -> bool
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
.
sourcepub unsafe fn ends_with_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool
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 ends_with_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool
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
.
sourcepub unsafe fn ends_with_q_char_case_sensitivity(
&self,
c: impl CastInto<Ref<QChar>>,
cs: CaseSensitivity
) -> bool
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 ends_with_q_char_case_sensitivity( &self, c: impl CastInto<Ref<QChar>>, cs: CaseSensitivity ) -> bool
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
.
sourcepub unsafe fn ends_with_q_string_view(
&self,
s: impl CastInto<Ref<QStringView>>
) -> bool
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 ends_with_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> bool
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
.
sourcepub unsafe fn ends_with_q_latin1_string(
&self,
s: impl CastInto<Ref<QLatin1String>>
) -> bool
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 ends_with_q_latin1_string( &self, s: impl CastInto<Ref<QLatin1String>> ) -> bool
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
.
sourcepub unsafe fn front(&self) -> CppBox<QLatin1Char>
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 front(&self) -> CppBox<QLatin1Char>
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
.
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[]().
sourcepub unsafe fn index(&self, i: c_int) -> CppBox<QLatin1Char>
pub unsafe fn index(&self, i: c_int) -> CppBox<QLatin1Char>
Returns the character at position pos in this object.
Calls C++ function: QLatin1Char QLatin1String::operator[](int i) const
.
sourcepub unsafe fn index_of_q_string_view_int_case_sensitivity(
&self,
s: impl CastInto<Ref<QStringView>>,
from: c_int,
cs: CaseSensitivity
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_string_view_int_case_sensitivity( &self, s: impl CastInto<Ref<QStringView>>, from: c_int, cs: CaseSensitivity ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QStringView s, int from = …, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn index_of_q_latin1_string_int_case_sensitivity(
&self,
s: impl CastInto<Ref<QLatin1String>>,
from: c_int,
cs: CaseSensitivity
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_latin1_string_int_case_sensitivity( &self, s: impl CastInto<Ref<QLatin1String>>, from: c_int, cs: CaseSensitivity ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QLatin1String s, int from = …, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn index_of_q_char_int_case_sensitivity(
&self,
c: impl CastInto<Ref<QChar>>,
from: c_int,
cs: CaseSensitivity
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_char_int_case_sensitivity( &self, c: impl CastInto<Ref<QChar>>, from: c_int, cs: CaseSensitivity ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QChar c, int from = …, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn index_of_q_string_view_int(
&self,
s: impl CastInto<Ref<QStringView>>,
from: c_int
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_string_view_int( &self, s: impl CastInto<Ref<QStringView>>, from: c_int ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QStringView s, int from = …) const
.
sourcepub unsafe fn index_of_q_string_view(
&self,
s: impl CastInto<Ref<QStringView>>
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QStringView s) const
.
sourcepub unsafe fn index_of_q_latin1_string_int(
&self,
s: impl CastInto<Ref<QLatin1String>>,
from: c_int
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_latin1_string_int( &self, s: impl CastInto<Ref<QLatin1String>>, from: c_int ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QLatin1String s, int from = …) const
.
sourcepub unsafe fn index_of_q_latin1_string(
&self,
s: impl CastInto<Ref<QLatin1String>>
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_latin1_string( &self, s: impl CastInto<Ref<QLatin1String>> ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QLatin1String s) const
.
sourcepub unsafe fn index_of_q_char_int(
&self,
c: impl CastInto<Ref<QChar>>,
from: c_int
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_char_int( &self, c: impl CastInto<Ref<QChar>>, from: c_int ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QChar c, int from = …) const
.
sourcepub unsafe fn index_of_q_char(&self, c: impl CastInto<Ref<QChar>>) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn index_of_q_char(&self, c: impl CastInto<Ref<QChar>>) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::indexOf(QChar c) const
.
sourcepub unsafe fn is_empty(&self) -> bool
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 is_empty(&self) -> bool
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
.
sourcepub unsafe fn is_null(&self) -> bool
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 is_null(&self) -> bool
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
.
sourcepub unsafe fn last_index_of_q_string_view_int_case_sensitivity(
&self,
s: impl CastInto<Ref<QStringView>>,
from: c_int,
cs: CaseSensitivity
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
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
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QStringView s, int from = …, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn last_index_of_q_latin1_string_int_case_sensitivity(
&self,
s: impl CastInto<Ref<QLatin1String>>,
from: c_int,
cs: CaseSensitivity
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
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
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QLatin1String s, int from = …, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn last_index_of_q_char_int_case_sensitivity(
&self,
c: impl CastInto<Ref<QChar>>,
from: c_int,
cs: CaseSensitivity
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn last_index_of_q_char_int_case_sensitivity( &self, c: impl CastInto<Ref<QChar>>, from: c_int, cs: CaseSensitivity ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QChar c, int from = …, Qt::CaseSensitivity cs = …) const
.
sourcepub unsafe fn last_index_of_q_string_view_int(
&self,
s: impl CastInto<Ref<QStringView>>,
from: c_int
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn last_index_of_q_string_view_int( &self, s: impl CastInto<Ref<QStringView>>, from: c_int ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QStringView s, int from = …) const
.
sourcepub unsafe fn last_index_of_q_string_view(
&self,
s: impl CastInto<Ref<QStringView>>
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn last_index_of_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QStringView s) const
.
sourcepub unsafe fn last_index_of_q_latin1_string_int(
&self,
s: impl CastInto<Ref<QLatin1String>>,
from: c_int
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn last_index_of_q_latin1_string_int( &self, s: impl CastInto<Ref<QLatin1String>>, from: c_int ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QLatin1String s, int from = …) const
.
sourcepub unsafe fn last_index_of_q_latin1_string(
&self,
s: impl CastInto<Ref<QLatin1String>>
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn last_index_of_q_latin1_string( &self, s: impl CastInto<Ref<QLatin1String>> ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QLatin1String s) const
.
sourcepub unsafe fn last_index_of_q_char_int(
&self,
c: impl CastInto<Ref<QChar>>,
from: c_int
) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn last_index_of_q_char_int( &self, c: impl CastInto<Ref<QChar>>, from: c_int ) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QChar c, int from = …) const
.
sourcepub unsafe fn last_index_of_q_char(&self, c: impl CastInto<Ref<QChar>>) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn last_index_of_q_char(&self, c: impl CastInto<Ref<QChar>>) -> c_int
cpp_lib_version="5.14.0"
only.Calls C++ function: int QLatin1String::lastIndexOf(QChar c) const
.
sourcepub unsafe fn latin1(&self) -> *const c_char
pub unsafe fn latin1(&self) -> *const c_char
Returns the Latin-1 string stored in this object.
Calls C++ function: const char* QLatin1String::latin1() const
.
Returns the Latin-1 string stored in this object.
sourcepub unsafe fn left(&self, n: c_int) -> CppBox<QLatin1String>
pub unsafe fn left(&self, n: c_int) -> CppBox<QLatin1String>
Returns the substring of length length starting at position 0 in this object.
Calls C++ function: QLatin1String QLatin1String::left(int n) const
.
sourcepub unsafe fn mid_1a(&self, pos: c_int) -> CppBox<QLatin1String>
pub unsafe fn mid_1a(&self, pos: c_int) -> CppBox<QLatin1String>
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
.
sourcepub unsafe fn mid_2a(&self, pos: c_int, n: c_int) -> CppBox<QLatin1String>
pub unsafe fn mid_2a(&self, pos: c_int, n: c_int) -> CppBox<QLatin1String>
This is an overloaded function.
Calls C++ function: QLatin1String QLatin1String::mid(int pos, int n) const
.
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.
sourcepub unsafe fn new() -> CppBox<QLatin1String>
pub unsafe fn new() -> CppBox<QLatin1String>
Constructs a QLatin1String object that stores a nullptr.
Calls C++ function: [constructor] void QLatin1String::QLatin1String()
.
Constructs a QLatin1String object that stores a nullptr.
This function was introduced in Qt 5.6.
sourcepub unsafe fn from_char(s: *const c_char) -> CppBox<QLatin1String>
pub unsafe fn from_char(s: *const c_char) -> CppBox<QLatin1String>
Constructs a QLatin1String object that stores str.
Calls C++ function: [constructor] void QLatin1String::QLatin1String(const char* s)
.
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().
sourcepub unsafe fn from_char_int(
s: *const c_char,
sz: c_int
) -> CppBox<QLatin1String>
pub unsafe fn from_char_int( s: *const c_char, sz: c_int ) -> CppBox<QLatin1String>
Constructs a QLatin1String object that stores str with size.
Calls C++ function: [constructor] void QLatin1String::QLatin1String(const char* s, int sz)
.
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().
sourcepub unsafe fn from_q_byte_array(
s: impl CastInto<Ref<QByteArray>>
) -> CppBox<QLatin1String>
pub unsafe fn from_q_byte_array( s: impl CastInto<Ref<QByteArray>> ) -> CppBox<QLatin1String>
Constructs a QLatin1String object that stores str.
Calls C++ function: [constructor] void QLatin1String::QLatin1String(const QByteArray& s)
.
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().
sourcepub unsafe fn from_2_char(
f: *const c_char,
l: *const c_char
) -> CppBox<QLatin1String>
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_2_char( f: *const c_char, l: *const c_char ) -> CppBox<QLatin1String>
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)
.
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.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QLatin1String>>
) -> CppBox<QLatin1String>
pub unsafe fn new_copy( other: impl CastInto<Ref<QLatin1String>> ) -> CppBox<QLatin1String>
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)
.
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:
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.
sourcepub unsafe fn right(&self, n: c_int) -> CppBox<QLatin1String>
pub unsafe fn right(&self, n: c_int) -> CppBox<QLatin1String>
Returns the substring of length length starting at position size() - length in this object.
Calls C++ function: QLatin1String QLatin1String::right(int n) const
.
sourcepub unsafe fn size(&self) -> c_int
pub unsafe fn size(&self) -> c_int
Returns the size of the Latin-1 string stored in this object.
Calls C++ function: int QLatin1String::size() const
.
Returns the size of the Latin-1 string stored in this object.
sourcepub unsafe fn starts_with_q_string_view_case_sensitivity(
&self,
s: impl CastInto<Ref<QStringView>>,
cs: CaseSensitivity
) -> bool
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 starts_with_q_string_view_case_sensitivity( &self, s: impl CastInto<Ref<QStringView>>, cs: CaseSensitivity ) -> bool
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
.
sourcepub unsafe fn starts_with_q_latin1_string_case_sensitivity(
&self,
s: impl CastInto<Ref<QLatin1String>>,
cs: CaseSensitivity
) -> bool
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 starts_with_q_latin1_string_case_sensitivity( &self, s: impl CastInto<Ref<QLatin1String>>, cs: CaseSensitivity ) -> bool
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
.
sourcepub unsafe fn starts_with_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool
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 starts_with_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool
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
.
sourcepub unsafe fn starts_with_q_char_case_sensitivity(
&self,
c: impl CastInto<Ref<QChar>>,
cs: CaseSensitivity
) -> bool
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 starts_with_q_char_case_sensitivity( &self, c: impl CastInto<Ref<QChar>>, cs: CaseSensitivity ) -> bool
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
.
sourcepub unsafe fn starts_with_q_string_view(
&self,
s: impl CastInto<Ref<QStringView>>
) -> bool
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 starts_with_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> bool
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
.
sourcepub unsafe fn starts_with_q_latin1_string(
&self,
s: impl CastInto<Ref<QLatin1String>>
) -> bool
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 starts_with_q_latin1_string( &self, s: impl CastInto<Ref<QLatin1String>> ) -> bool
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
.
sourcepub unsafe fn trimmed(&self) -> CppBox<QLatin1String>
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 trimmed(&self) -> CppBox<QLatin1String>
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
.
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.
Trait Implementations§
source§impl Add<Ref<QStringRef>> for &QLatin1String
impl Add<Ref<QStringRef>> for &QLatin1String
source§impl Begin for QLatin1String
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.
impl Begin for QLatin1String
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.source§unsafe fn begin(&self) -> *const c_char
unsafe fn begin(&self) -> *const c_char
Returns a const STL-style iterator pointing to the first character in the string.
Calls C++ function: const char* QLatin1String::begin() const
.
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.
source§impl CppDeletable for QLatin1String
impl CppDeletable for QLatin1String
source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
Calls C++ function: [destructor] void QLatin1String::~QLatin1String()
.
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:
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.
source§impl Data for QLatin1String
impl Data for QLatin1String
source§impl End for QLatin1String
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.
impl End for QLatin1String
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.source§unsafe fn end(&self) -> *const c_char
unsafe fn end(&self) -> *const c_char
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
.
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.
source§impl Ge<*const i8> for QLatin1String
impl Ge<*const i8> for QLatin1String
source§unsafe fn ge(&self, s: &*const c_char) -> bool
unsafe fn ge(&self, s: &*const c_char) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator>=(const char* s) const
.
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.
source§impl Ge<Ref<QByteArray>> for QLatin1String
impl Ge<Ref<QByteArray>> for QLatin1String
source§unsafe fn ge(&self, s: &Ref<QByteArray>) -> bool
unsafe fn ge(&self, s: &Ref<QByteArray>) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator>=(const QByteArray& s) const
.
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.
source§impl Ge<Ref<QChar>> for QLatin1String
impl Ge<Ref<QChar>> for QLatin1String
source§unsafe fn ge(&self, rhs: &Ref<QChar>) -> bool
unsafe fn ge(&self, rhs: &Ref<QChar>) -> 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>=(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
.
source§impl Ge<Ref<QLatin1String>> for QLatin1String
impl Ge<Ref<QLatin1String>> for QLatin1String
source§unsafe fn ge(&self, s2: &Ref<QLatin1String>) -> bool
unsafe fn ge(&self, s2: &Ref<QLatin1String>) -> 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>=(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
.
source§impl Ge<Ref<QString>> for QLatin1String
impl Ge<Ref<QString>> for QLatin1String
source§unsafe fn ge(&self, s: &Ref<QString>) -> bool
unsafe fn ge(&self, s: &Ref<QString>) -> bool
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
.
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().
source§impl Ge<Ref<QStringRef>> for QLatin1String
impl Ge<Ref<QStringRef>> for QLatin1String
source§unsafe fn ge(&self, rhs: &Ref<QStringRef>) -> bool
unsafe fn ge(&self, rhs: &Ref<QStringRef>) -> 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>=(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
.
source§impl Ge<Ref<QStringView>> for QLatin1String
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.
impl Ge<Ref<QStringView>> for QLatin1String
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.source§unsafe fn ge(&self, rhs: &Ref<QStringView>) -> bool
unsafe fn ge(&self, rhs: &Ref<QStringView>) -> 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>=(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
.
source§impl Gt<*const i8> for QLatin1String
impl Gt<*const i8> for QLatin1String
source§unsafe fn gt(&self, s: &*const c_char) -> bool
unsafe fn gt(&self, s: &*const c_char) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator>(const char* s) const
.
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.
source§impl Gt<Ref<QByteArray>> for QLatin1String
impl Gt<Ref<QByteArray>> for QLatin1String
source§unsafe fn gt(&self, s: &Ref<QByteArray>) -> bool
unsafe fn gt(&self, s: &Ref<QByteArray>) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator>(const QByteArray& s) const
.
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.
source§impl Gt<Ref<QLatin1String>> for QLatin1String
impl Gt<Ref<QLatin1String>> for QLatin1String
source§impl Gt<Ref<QString>> for QLatin1String
impl Gt<Ref<QString>> for QLatin1String
source§unsafe fn gt(&self, s: &Ref<QString>) -> bool
unsafe fn gt(&self, s: &Ref<QString>) -> bool
Returns true
if this string is lexically greater than string other; otherwise returns false
.
Calls C++ function: bool QLatin1String::operator>(const QString& s) const
.
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().
source§impl Gt<Ref<QStringRef>> for QLatin1String
impl Gt<Ref<QStringRef>> for QLatin1String
source§impl Gt<Ref<QStringView>> for QLatin1String
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.
impl Gt<Ref<QStringView>> for QLatin1String
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.source§impl Le<*const i8> for QLatin1String
impl Le<*const i8> for QLatin1String
source§unsafe fn le(&self, s: &*const c_char) -> bool
unsafe fn le(&self, s: &*const c_char) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator<=(const char* s) const
.
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.
source§impl Le<Ref<QByteArray>> for QLatin1String
impl Le<Ref<QByteArray>> for QLatin1String
source§unsafe fn le(&self, s: &Ref<QByteArray>) -> bool
unsafe fn le(&self, s: &Ref<QByteArray>) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator<=(const QByteArray& s) const
.
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.
source§impl Le<Ref<QChar>> for QLatin1String
impl Le<Ref<QChar>> for QLatin1String
source§unsafe fn le(&self, rhs: &Ref<QChar>) -> bool
unsafe fn le(&self, rhs: &Ref<QChar>) -> 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<=(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
.
source§impl Le<Ref<QLatin1String>> for QLatin1String
impl Le<Ref<QLatin1String>> for QLatin1String
source§unsafe fn le(&self, s2: &Ref<QLatin1String>) -> bool
unsafe fn le(&self, s2: &Ref<QLatin1String>) -> 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<=(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
.
source§impl Le<Ref<QString>> for QLatin1String
impl Le<Ref<QString>> for QLatin1String
source§unsafe fn le(&self, s: &Ref<QString>) -> bool
unsafe fn le(&self, s: &Ref<QString>) -> bool
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
.
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().
source§impl Le<Ref<QStringRef>> for QLatin1String
impl Le<Ref<QStringRef>> for QLatin1String
source§unsafe fn le(&self, rhs: &Ref<QStringRef>) -> bool
unsafe fn le(&self, rhs: &Ref<QStringRef>) -> 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<=(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
.
source§impl Le<Ref<QStringView>> for QLatin1String
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.
impl Le<Ref<QStringView>> for QLatin1String
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.source§unsafe fn le(&self, rhs: &Ref<QStringView>) -> bool
unsafe fn le(&self, rhs: &Ref<QStringView>) -> 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<=(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
.
source§impl Lt<*const i8> for QLatin1String
impl Lt<*const i8> for QLatin1String
source§unsafe fn lt(&self, s: &*const c_char) -> bool
unsafe fn lt(&self, s: &*const c_char) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator<(const char* s) const
.
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.
source§impl Lt<Ref<QByteArray>> for QLatin1String
impl Lt<Ref<QByteArray>> for QLatin1String
source§unsafe fn lt(&self, s: &Ref<QByteArray>) -> bool
unsafe fn lt(&self, s: &Ref<QByteArray>) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator<(const QByteArray& s) const
.
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.
source§impl Lt<Ref<QLatin1String>> for QLatin1String
impl Lt<Ref<QLatin1String>> for QLatin1String
source§impl Lt<Ref<QString>> for QLatin1String
impl Lt<Ref<QString>> for QLatin1String
source§unsafe fn lt(&self, s: &Ref<QString>) -> bool
unsafe fn lt(&self, s: &Ref<QString>) -> bool
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
.
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.
source§impl Lt<Ref<QStringRef>> for QLatin1String
impl Lt<Ref<QStringRef>> for QLatin1String
source§impl Lt<Ref<QStringView>> for QLatin1String
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.
impl Lt<Ref<QStringView>> for QLatin1String
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.source§impl PartialEq<*const i8> for QLatin1String
impl PartialEq<*const i8> for QLatin1String
source§fn eq(&self, s: &*const c_char) -> bool
fn eq(&self, s: &*const c_char) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator==(const char* s) const
.
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.
source§impl PartialEq<Ref<QByteArray>> for QLatin1String
impl PartialEq<Ref<QByteArray>> for QLatin1String
source§fn eq(&self, s: &Ref<QByteArray>) -> bool
fn eq(&self, s: &Ref<QByteArray>) -> bool
This is an overloaded function.
Calls C++ function: bool QLatin1String::operator==(const QByteArray& s) const
.
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.
source§impl PartialEq<Ref<QChar>> for QLatin1String
impl PartialEq<Ref<QChar>> for QLatin1String
source§fn eq(&self, rhs: &Ref<QChar>) -> bool
fn eq(&self, rhs: &Ref<QChar>) -> bool
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
.
source§impl PartialEq<Ref<QLatin1String>> for QLatin1String
impl PartialEq<Ref<QLatin1String>> for QLatin1String
source§fn eq(&self, s2: &Ref<QLatin1String>) -> bool
fn eq(&self, s2: &Ref<QLatin1String>) -> bool
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
.
source§impl PartialEq<Ref<QString>> for QLatin1String
impl PartialEq<Ref<QString>> for QLatin1String
source§fn eq(&self, s: &Ref<QString>) -> bool
fn eq(&self, s: &Ref<QString>) -> bool
Returns true
if this string is equal to string other; otherwise returns false
.
Calls C++ function: bool QLatin1String::operator==(const QString& s) const
.
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().
source§impl PartialEq<Ref<QStringRef>> for QLatin1String
impl PartialEq<Ref<QStringRef>> for QLatin1String
source§fn eq(&self, rhs: &Ref<QStringRef>) -> bool
fn eq(&self, rhs: &Ref<QStringRef>) -> bool
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
.
source§impl PartialEq<Ref<QStringView>> for QLatin1String
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.
impl PartialEq<Ref<QStringView>> for QLatin1String
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.source§fn eq(&self, rhs: &Ref<QStringView>) -> bool
fn eq(&self, rhs: &Ref<QStringView>) -> bool
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
.