4#include <QtQml/qqmlfile.h>
5#include <QtCore/QCoreApplication>
6#include <QtCore/QTranslator>
7#include <QQmlComponent>
10#include <QtQml/private/qqmlfileselector_p.h>
53#if QT_CONFIG(translation)
67#if QT_CONFIG(translation)
72 auto translator = std::make_unique<QTranslator>();
73 if (!uiLanguage.value().isEmpty()) {
79 activeTranslator.swap(translator);
82 activeTranslator.reset();
120 c->loadFromModule(uri,
type);
127 switch (
c->status()) {
129 qWarning() <<
"QQmlApplicationEngine failed to load component";
131 q->objectCreated(
nullptr,
c->url());
132 q->objectCreationFailed(
c->url());
138 qWarning() <<
"QQmlApplicationEngine failed to create component";
140 q->objectCreated(
nullptr,
c->url());
141 q->objectCreationFailed(
c->url());
161 if (!
c->isLoading()) {
390 d->initialProperties = initialProperties;
405 if (
d->isInitialized) {
406 qWarning() <<
"QQmlApplicationEngine::setExtraFileSelectors()"
407 <<
"called after loading QML files. This has no effect.";
409 d->extraFileSelectors = extraFileSelectors;
444#include "moc_qqmlapplicationengine.cpp"
static void quit()
\threadsafe
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
static bool installTranslator(QTranslator *messageFile)
Adds the translation file translationFile to the list of translation files to be used for translation...
static bool removeTranslator(QTranslator *messageFile)
Removes the translation file translationFile from the list of translation files used by this applicat...
static void exit(int retcode=0)
Tells the application to exit with a return code.
\inmodule QtCore \reentrant
QString path() const
Returns the file's path.
void setExtraSelectors(const QStringList &list)
Sets the list of extra selectors which have been added programmatically to this instance.
static void addToDebugServer(QJSEngine *q)
static void removeFromDebugServer(QJSEngine *q)
static QString path(LibraryPath p)
const T & constLast() const noexcept
qsizetype removeAll(const AT &t)
QString bcp47Name() const
Returns the BCP47 field names joined with dashes.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
void ensureLoadingFinishes(QQmlComponent *component)
QStringList extraFileSelectors
void finishLoad(QQmlComponent *component)
void _q_loadTranslations()
QVariantMap initialProperties
QList< QObject * > objects
QString translationsDirectory
QQmlApplicationEnginePrivate(QQmlEngine *e)
~QQmlApplicationEnginePrivate()
void startLoad(const QUrl &url, const QByteArray &data=QByteArray(), bool dataFlag=false)
QQmlApplicationEngine provides a convenient way to load an application from a single QML file.
void setInitialProperties(const QVariantMap &initialProperties)
Sets the initialProperties with which the QML component gets initialized after it gets loaded.
void loadFromModule(QAnyStringView uri, QAnyStringView typeName)
Loads the QML type typeName from the module specified by uri.
QList< QObject * > rootObjects() const
Returns a list of all the root objects instantiated by the QQmlApplicationEngine.
~QQmlApplicationEngine() override
Destroys the QQmlApplicationEngine and all QML objects it loaded.
QQmlApplicationEngine(QObject *parent=nullptr)
Create a new QQmlApplicationEngine with the given parent.
void loadData(const QByteArray &data, const QUrl &url=QUrl())
Loads the QML given in data.
void load(const QUrl &url)
Loads the root QML file located at url.
void setExtraFileSelectors(const QStringList &extraFileSelectors)
Sets the extraFileSelectors to be passed to the internal QQmlFileSelector used for resolving URLs to ...
The QQmlComponent class encapsulates a QML component definition.
void statusChanged(QQmlComponent::Status)
Emitted whenever the component's status changes.
void warning(const QQmlError &)
The QQmlEngine class provides an environment for instantiating QML components.
void quit()
This signal is emitted when the QML loaded by the engine would like to quit.
void exit(int retCode)
This signal is emitted when the QML loaded by the engine would like to exit from the event loop with ...
A class for applying a QFileSelector to QML file loading.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to QFile.
\macro QT_RESTRICTED_CAST_FROM_ASCII
void clear()
Clears the contents of the string and makes it null.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QUrl fromUserInput(const QString &userInput, const QString &workingDirectory=QString(), UserInputResolutionOptions options=DefaultResolution)
Returns a valid URL from a user supplied userInput string if one can be deduced.
QString scheme() const
Returns the scheme of the URL.
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLdouble GLdouble GLdouble GLdouble q
QLatin1StringView QLatin1String
QFileInfo fi("c:/temp/foo")
[newstuff]
QFileSelector selector
[1]
QUrl url("example.com")
[constructor-url-reference]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent