DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dapploader.h
1// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DAPPLOADER_H
6#define DAPPLOADER_H
7
8#include <DObject>
9
10#include <dtkdeclarative_global.h>
11#include <QQmlComponent>
12
13QT_BEGIN_NAMESPACE
14class QString;
15class QQmlEngine;
16class QQuickWindow;
17class QGuiApplication;
18QT_END_NAMESPACE
19
20DQUICK_BEGIN_NAMESPACE
21
22class DAppLoaderPrivate;
23class DAppLoader : public QObject, public DTK_CORE_NAMESPACE::DObject
24{
25 Q_OBJECT
26 D_DECLARE_PRIVATE(DAppLoader)
27 D_PRIVATE_SLOT(void _q_onMainComponentStatusChanged(QQmlComponent::Status))
28 D_PRIVATE_SLOT(void _q_onPreloadCreated(QObject *, const QUrl &))
29 D_PRIVATE_SLOT(void _q_onComponentProgressChanged())
30
31public:
32 DAppLoader() = delete ;
33 DAppLoader(const QString &appName, const QString &appPath = QString(), QObject *parent = nullptr);
35
36 void addPluginPath(const QString &dir);
37 QStringList pluginPaths() const;
38
39 int exec(int &argc, char **argv);
40 static DAppLoader *instance() { return self; }
41
42Q_SIGNALS:
43 void loadFinished();
44private:
45 static DAppLoader *self;
46};
47
48DQUICK_END_NAMESPACE
49
50#endif // DAPPLOADER_H
Definition dapploader.h:24