Struct qmetaobject::QString

source ·
#[repr(C)]
pub struct QString { /* private fields */ }
Expand description

Wrapper around QString class.

Implementations§

source§

impl QString

source

pub fn to_slice(&self) -> &[u16]

Return a slice containing the UTF-16 data.

source

pub fn is_empty(&self) -> bool

Wrapper around bool QString::isEmpty() const method

use qttypes::QString;

assert!(QString::default().is_empty());
assert!(QString::from("").is_empty());
assert!(!QString::from("abc").is_empty());
source

pub fn is_null(&self) -> bool

Wrapper around bool QString::isNull() const method

use qttypes::QString;

assert!(QString::default().is_null());
assert!(!QString::from("").is_null());
assert!(!QString::from("abc").is_null());
source

pub fn len(&self) -> usize

Returns the number of characters in this string.

source

pub fn shrink_to_fit(&mut self)

Wrapper around void QString::shrink_to_fit() method.

source

pub fn to_upper(&self) -> QString

Wrapper around QString QString::toUpper() const method.

source

pub fn to_lower(&self) -> QString

Wrapper around QString QString::toLower() const method.

source

pub fn trimmed(&self) -> QString

Wrapper around QString QString::trimmed() const method.

source

pub fn to_case_folded(&self) -> QString

source

pub fn simplified(&self) -> QString

Wrapper around QString QString::simplified() const method.

source

pub fn to_int(&self, base: i32) -> Result<i32, ()>

source

pub fn to_long_long(&self, base: i32) -> Result<i64, ()>

source

pub fn normalized( &self, mode: NormalizationForm, version: UnicodeVersion ) -> QString

source

pub fn append(&mut self, other: QString) -> QString

Trait Implementations§

source§

impl Add for QString

§

type Output = QString

The resulting type after applying the + operator.
source§

fn add(self, rhs: QString) -> <QString as Add>::Output

Performs the + operation. Read more
source§

impl AddAssign for QString

source§

fn add_assign(&mut self, rhs: QString)

Performs the += operation. Read more
source§

impl Clone for QString

source§

fn clone(&self) -> QString

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QString

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for QString

source§

fn default() -> QString

Returns the “default value” for a type. Read more
source§

impl Display for QString

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Drop for QString

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> From<&'a str> for QString

source§

fn from(s: &'a str) -> QString

Copy the data from a &str.

source§

impl From<QString> for QByteArray

source§

fn from(s: QString) -> QByteArray

Converts a QString to a QByteArray

source§

impl From<QString> for QJSValue

source§

fn from(a: QString) -> QJSValue

Converts to this type from the input type.
source§

impl From<QString> for QJsonValue

source§

fn from(v: QString) -> QJsonValue

Converts to this type from the input type.
source§

impl From<QString> for QUrl

source§

fn from(qstring: QString) -> QUrl

Converts to this type from the input type.
source§

impl From<QString> for QVariant

source§

fn from(a: QString) -> QVariant

Wrapper around QVariant(const QString &) constructor.

source§

impl From<QUrl> for QString

source§

fn from(qurl: QUrl) -> QString

Wrapper around QUrl::toString(QUrl::FormattingOptions=...) method.

Wrapper-specific

Formatting options are left at defaults.

source§

impl From<String> for QString

source§

fn from(s: String) -> QString

Converts to this type from the input type.
source§

impl Index<QString> for QVariantMap

source§

fn index(&self, key: QString) -> &<QVariantMap as Index<QString>>::Output

Wrapper around at(int) method.

§

type Output = QVariant

The returned type after indexing.
source§

impl IndexMut<QString> for QVariantMap

source§

fn index_mut( &mut self, key: QString ) -> &mut <QVariantMap as Index<QString>>::Output

Wrapper around operator[](int) operator method.

source§

impl Into<QString> for QJsonValue

source§

fn into(self) -> QString

Converts this type into the (usually inferred) input type.
source§

impl Into<String> for QString

source§

fn into(self) -> String

Converts this type into the (usually inferred) input type.
source§

impl Ord for QString

source§

fn cmp(&self, other: &QString) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for QString

source§

fn eq(&self, other: &QString) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl PartialOrd for QString

source§

fn lt(&self, other: &QString) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn gt(&self, other: &QString) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn le(&self, other: &QString) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn ge(&self, other: &QString) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

fn partial_cmp(&self, other: &QString) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

impl QMetaType for QString

source§

fn register(_name: Option<&CStr>) -> i32

Registers the type. Read more
source§

fn id() -> i32

source§

fn to_qvariant(&self) -> QVariant

Returns a QVariant containing a copy of this object
source§

fn from_qvariant(variant: QVariant) -> Option<Self>

Attempt to convert from a QVariant to this type.
source§

const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString> = None

If this is set to a function, it enable the conversion to and from QString
source§

const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self> = None

source§

impl TryFrom<&Path> for QString

§

type Error = ()

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

fn try_from(s: &Path) -> Result<QString, <QString as TryFrom<&Path>>::Error>

Performs the conversion.
source§

impl Eq for QString

source§

impl StructuralEq for QString

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> PropertyType for T
where T: QMetaType,

source§

fn register_type(name: &CStr) -> i32

source§

unsafe fn pass_to_qt(&mut self, a: *mut c_void)

source§

unsafe fn read_from_qt(a: *const c_void) -> T

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

§

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

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

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

Performs the conversion.