[]Struct qmetaobject::qtdeclarative::QmlEngine

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

Wrap a Qt Application and a QmlEngine

Note that since there can only be one Application in the process, creating two QmlEngine at the same time is not allowed. Doing that will panic.

Methods

impl QmlEngine[src]

pub fn new() -> QmlEngine[src]

create a new QmlEngine

pub fn load_file(&mut self, path: QString)[src]

Loads a file as a qml file (See QQmlApplicationEngine::load(const QString & filePath))

pub fn load_data(&mut self, data: QByteArray)[src]

Loads qml data (See QQmlApplicationEngine::loadData)

pub fn load_data_as(&mut self, data: QByteArray, url: QUrl)[src]

Loads qml data with url as base url component (See QQmlApplicationEngine::loadData)

pub fn exec(&self)[src]

Launches the application

pub fn quit(&self)[src]

Closes the application

pub fn set_property(&mut self, name: QString, value: QVariant)[src]

Sets a property for this QML context (calls QQmlEngine::rootContext()->setContextProperty)

pub fn set_object_property<T: QObject + Sized>(
    &mut self,
    name: QString,
    obj: QObjectPinned<T>
)
[src]

Sets a property for this QML context (calls QQmlEngine::rootContext()->setContextProperty)

pub fn invoke_method(&mut self, name: QByteArray, args: &[QVariant]) -> QVariant[src]

pub fn new_qobject<T: QObject>(&mut self, obj: T) -> QJSValue[src]

Give a QObject to the engine by wraping it in a QJSValue

This will create the C++ object. Panic if the C++ object was already created.

pub fn add_import_path(&mut self, path: QString)[src]

Adds an import path for this QML engine (calls QQmlEngine::addImportPath)

Trait Implementations

impl Drop for QmlEngine

impl Default for QmlEngine

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<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.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]