Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlapplicationengine.h
Go to the documentation of this file.
1// Copyright (C) 2016 Research In Motion.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQMLAPPLICATIONENGINE_H
5#define QQMLAPPLICATIONENGINE_H
6
7#include <QtQml/qqmlengine.h>
8
9#include <QtCore/qurl.h>
10#include <QtCore/qobject.h>
11#include <QtCore/qlist.h>
12
14
16class Q_QML_EXPORT QQmlApplicationEngine : public QQmlEngine
17{
19public:
20 QQmlApplicationEngine(QObject *parent = nullptr);
21 QQmlApplicationEngine(const QUrl &url, QObject *parent = nullptr);
23 QObject *parent = nullptr);
24 QQmlApplicationEngine(const QString &filePath, QObject *parent = nullptr);
25 ~QQmlApplicationEngine() override;
26
27 QList<QObject*> rootObjects() const;
28
29public Q_SLOTS:
30 void load(const QUrl &url);
31 void load(const QString &filePath);
32 void loadFromModule(QAnyStringView uri, QAnyStringView typeName);
33 void setInitialProperties(const QVariantMap &initialProperties);
34 void setExtraFileSelectors(const QStringList &extraFileSelectors);
35 void loadData(const QByteArray &data, const QUrl &url = QUrl());
36
38 void objectCreated(QObject *object, const QUrl &url);
40
41private:
42 Q_DISABLE_COPY(QQmlApplicationEngine)
43 Q_PRIVATE_SLOT(d_func(), void _q_loadTranslations())
44 Q_DECLARE_PRIVATE(QQmlApplicationEngine)
45};
46
48
49#endif
\inmodule QtCore
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qobject.h:103
QQmlApplicationEngine provides a convenient way to load an application from a single QML file.
void objectCreationFailed(const QUrl &url)
void objectCreated(QObject *object, const QUrl &url)
This signal is emitted when an object finishes loading.
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
p1 load("image.bmp")
Combined button and popup list for selecting options.
const char * typeName
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_OBJECT
#define Q_SLOTS
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS
QUrl url("example.com")
[constructor-url-reference]