Struct qmetaobject::qtdeclarative::QmlEngine [−][src]
#[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.
Implementations
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_url(&mut self, url: QUrl)
[src]
Loads the root QML file located at url (See QQmlApplicationEngine::load(const QUrl &url))
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]
&mut self,
name: QString,
obj: QObjectPinned<'_, T>
)
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 wrapping 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)
pub fn cpp_ptr(&self) -> *mut c_void
[src]
Returns a pointer to the C++ object. The pointer is of the type QQmlEngine *
in C++.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for QmlEngine
impl Send for QmlEngine
impl Sync for QmlEngine
impl Unpin for QmlEngine
impl UnwindSafe for QmlEngine
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,