#[repr(C)]pub struct QQmlScriptString { /* private fields */ }
Expand description
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();
Implementations§
Source§impl QQmlScriptString
impl QQmlScriptString
Sourcepub unsafe fn boolean_literal(&self, ok: *mut bool) -> bool
pub unsafe fn boolean_literal(&self, ok: *mut bool) -> bool
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.
Sourcepub unsafe fn copy_from(
&self,
arg1: impl CastInto<Ref<QQmlScriptString>>,
) -> Ref<QQmlScriptString>
pub unsafe fn copy_from( &self, arg1: impl CastInto<Ref<QQmlScriptString>>, ) -> Ref<QQmlScriptString>
Assigns other to this.
Calls C++ function: QQmlScriptString& QQmlScriptString::operator=(const QQmlScriptString& arg1)
.
Assigns other to this.
Sourcepub unsafe fn is_empty(&self) -> bool
pub unsafe fn is_empty(&self) -> bool
Returns whether the QQmlScriptString is empty.
Calls C++ function: bool QQmlScriptString::isEmpty() const
.
Returns whether the QQmlScriptString is empty.
Sourcepub unsafe fn is_null_literal(&self) -> bool
pub unsafe fn is_null_literal(&self) -> bool
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.
Sourcepub unsafe fn is_undefined_literal(&self) -> bool
pub unsafe fn is_undefined_literal(&self) -> bool
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.
Sourcepub unsafe fn new() -> CppBox<QQmlScriptString>
pub unsafe fn new() -> CppBox<QQmlScriptString>
Constructs an empty instance.
Calls C++ function: [constructor] void QQmlScriptString::QQmlScriptString()
.
Constructs an empty instance.
Sourcepub unsafe fn new_copy(
arg1: impl CastInto<Ref<QQmlScriptString>>,
) -> CppBox<QQmlScriptString>
pub unsafe fn new_copy( arg1: impl CastInto<Ref<QQmlScriptString>>, ) -> CppBox<QQmlScriptString>
Copies other.
Calls C++ function: [constructor] void QQmlScriptString::QQmlScriptString(const QQmlScriptString& arg1)
.
Copies other.
Sourcepub unsafe fn number_literal(&self, ok: *mut bool) -> c_double
pub unsafe fn number_literal(&self, ok: *mut bool) -> c_double
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.
Sourcepub unsafe fn string_literal(&self) -> CppBox<QString>
pub unsafe fn string_literal(&self) -> CppBox<QString>
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§
Source§impl CppDeletable for QQmlScriptString
impl CppDeletable for QQmlScriptString
Source§impl PartialEq<Ref<QQmlScriptString>> for QQmlScriptString
impl PartialEq<Ref<QQmlScriptString>> for QQmlScriptString
Source§fn eq(&self, arg1: &Ref<QQmlScriptString>) -> bool
fn eq(&self, arg1: &Ref<QQmlScriptString>) -> bool
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!=().