[][src]Struct qt_qml::QQmlScriptString

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

QQmlScriptString is used to create QObject properties that accept a script "assignment" from QML.

C++ class: QQmlScriptString.

C++ documentation:

QQmlScriptString is used to create QObject properties that accept a script "assignment" from QML.

Normally, the following QML would result in a binding being established for the script property; i.e. script would be assigned the value obtained from running myObj.value = Math.max(myValue, 100)

MyType { script: myObj.value = Math.max(myValue, 100) }

If instead the property had a type of QQmlScriptString, the script itself -- myObj.value = Math.max(myValue, 100) -- would be passed to the script property and the class could choose how to handle it. Typically, the class will evaluate the script at some later time using a QQmlExpression.

QQmlExpression expr(scriptString); expr.evaluate();

Methods

impl QQmlScriptString[src]

pub unsafe fn boolean_literal(&self, ok: *mut bool) -> bool[src]

If the content of the QQmlScriptString is a boolean literal, returns the boolean value and sets ok to true. Otherwise returns false and sets ok to false.

Calls C++ function: bool QQmlScriptString::booleanLiteral(bool* ok) const.

C++ documentation:

If the content of the QQmlScriptString is a boolean literal, returns the boolean value and sets ok to true. Otherwise returns false and sets ok to false.

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

Assigns other to this.

Calls C++ function: QQmlScriptString& QQmlScriptString::operator=(const QQmlScriptString& arg1).

C++ documentation:

Assigns other to this.

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

Returns whether the QQmlScriptString is empty.

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

C++ documentation:

Returns whether the QQmlScriptString is empty.

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

Returns whether the content of the QQmlScriptString is the null literal.

Calls C++ function: bool QQmlScriptString::isNullLiteral() const.

C++ documentation:

Returns whether the content of the QQmlScriptString is the null literal.

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

Returns whether the content of the QQmlScriptString is the undefined literal.

Calls C++ function: bool QQmlScriptString::isUndefinedLiteral() const.

C++ documentation:

Returns whether the content of the QQmlScriptString is the undefined literal.

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

Constructs an empty instance.

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

C++ documentation:

Constructs an empty instance.

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

Copies other.

Calls C++ function: [constructor] void QQmlScriptString::QQmlScriptString(const QQmlScriptString& arg1).

C++ documentation:

Copies other.

pub unsafe fn number_literal(&self, ok: *mut bool) -> c_double[src]

If the content of the QQmlScriptString is a number literal, returns that number and sets ok to true. Otherwise returns 0.0 and sets ok to false.

Calls C++ function: double QQmlScriptString::numberLiteral(bool* ok) const.

C++ documentation:

If the content of the QQmlScriptString is a number literal, returns that number and sets ok to true. Otherwise returns 0.0 and sets ok to false.

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

If the content of the QQmlScriptString is a string literal, returns that string. Otherwise returns a null QString.

Calls C++ function: QString QQmlScriptString::stringLiteral() const.

C++ documentation:

If the content of the QQmlScriptString is a string literal, returns that string. Otherwise returns a null QString.

Trait Implementations

impl CppDeletable for QQmlScriptString[src]

unsafe fn delete(&self)[src]

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

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

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

Returns true if this and the other QQmlScriptString objects are equal.

Calls C++ function: bool QQmlScriptString::operator==(const QQmlScriptString& arg1) const.

C++ documentation:

Returns true if this and the other QQmlScriptString objects are equal.

See also operator!=().

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.