Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlapplicationengine_p.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_P_H
5#define QQMLAPPLICATIONENGINE_P_H
6
8#include "qqmlengine_p.h"
9#include <QCoreApplication>
10#include <QFileInfo>
11#include <QLibraryInfo>
12
13//
14// W A R N I N G
15// -------------
16//
17// This file is not part of the Qt API. It exists purely as an
18// implementation detail. This header file may change from version to
19// version without notice, or even be removed.
20//
21// We mean it.
22//
23
25
26class QFileSelector;
27class Q_QML_EXPORT QQmlApplicationEnginePrivate : public QQmlEnginePrivate
28{
29 Q_DECLARE_PUBLIC(QQmlApplicationEngine)
30public:
31 QQmlApplicationEnginePrivate();
32 ~QQmlApplicationEnginePrivate();
33 void ensureInitialized();
34 void init();
35 void cleanUp();
36
37 void startLoad(const QUrl &url, const QByteArray &data = QByteArray(), bool dataFlag = false);
38 void startLoad(QAnyStringView uri, QAnyStringView type);
39 void _q_loadTranslations();
40 void finishLoad(QQmlComponent *component);
41 void ensureLoadingFinishes(QQmlComponent *component);
42 void updateTranslationDirectory(const QUrl &url);
43
44 QList<QObject *> objects;
45 QVariantMap initialProperties;
46 QStringList extraFileSelectors;
47 QString translationsDirectory;
48#if QT_CONFIG(translation)
49 std::unique_ptr<QTranslator> activeTranslator;
50#endif
51 bool isInitialized = false;
52};
53
54QT_END_NAMESPACE
55
56#endif
QQmlApplicationEngine provides a convenient way to load an application from a single QML file.
static QUrl urlFromFilePath(const QString &filePath)
static QString translationsDirectoryFromLocalUrl(const QUrl &url)