[−][src]Struct qt_qml::QQmlScriptString
QQmlScriptString is used to create QObject properties that accept a script "assignment" from QML.
C++ class: QQmlScriptString.
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: impl CastInto<MutPtr<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.
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(
&mut self,
arg1: impl CastInto<Ref<QQmlScriptString>>
) -> MutRef<QQmlScriptString>[src]
&mut self,
arg1: impl CastInto<Ref<QQmlScriptString>>
) -> MutRef<QQmlScriptString>
Assigns other to this.
Calls C++ function: QQmlScriptString& QQmlScriptString::operator=(const QQmlScriptString& arg1).
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.
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.
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.
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().
Constructs an empty instance.
pub unsafe fn new_copy(
arg1: impl CastInto<Ref<QQmlScriptString>>
) -> CppBox<QQmlScriptString>[src]
arg1: impl CastInto<Ref<QQmlScriptString>>
) -> CppBox<QQmlScriptString>
Copies other.
Calls C++ function: [constructor] void QQmlScriptString::QQmlScriptString(const QQmlScriptString& arg1).
Copies other.
pub unsafe fn number_literal(&self, ok: impl CastInto<MutPtr<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.
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.
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(&mut 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.
Returns true if this and the other QQmlScriptString objects are equal.
See also operator!=().
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for QQmlScriptString
impl Send for QQmlScriptString
impl Sync for QQmlScriptString
impl Unpin for QQmlScriptString
impl UnwindSafe for QQmlScriptString
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>, [src]
U: CastFrom<T>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> StaticUpcast<T> for T[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,