Struct qmetaobject::qtdeclarative::QmlEngine [−][src]
#[repr(C)]pub struct QmlEngine { /* fields omitted */ }
Expand description
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.
Implementations
Loads a file as a qml file (See QQmlApplicationEngine::load(const QString & filePath))
Loads the root QML file located at url (See QQmlApplicationEngine::load(const QUrl &url))
Loads qml data (See QQmlApplicationEngine::loadData)
Loads qml data with url
as base url component (See QQmlApplicationEngine::loadData)
Sets a property for this QML context (calls QQmlEngine::rootContext()->setContextProperty)
Sets an object for this QML context (calls QQmlEngine::rootContext()->setContextObject)
pub fn set_object_property<T: QObject + Sized>(
&mut self,
name: QString,
obj: QObjectPinned<'_, T>
)
pub fn set_object_property<T: QObject + Sized>(
&mut self,
name: QString,
obj: QObjectPinned<'_, T>
)
Sets a property for this QML context (calls QQmlEngine::rootContext()->setContextProperty)
Give a QObject to the engine by wrapping it in a QJSValue
This will create the C++ object. Panic if the C++ object was already created.
Adds an import path for this QML engine (calls QQmlEngine::addImportPath)