DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dapploader_p.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_P_H
6#define DAPPLOADER_P_H
7
8#include <QString>
9#include <DObjectPrivate>
10#include <QQmlIncubationController>
11
12#include "dapploader.h"
13#include <private/qsgrenderloop_p.h>
14#include <private/qquickitemchangelistener_p.h>
15#include <private/qquicktransitionmanager_p_p.h>
16
17QT_BEGIN_NAMESPACE
18class QQmlApplicationEngine;
19class QQuickItem;
20class QQuickTransition;
21QT_END_NAMESPACE
22
23DQUICK_BEGIN_NAMESPACE
24
25class DAppLoaderPrivate;
26class DWindowOverlayTransitionManager : public QQuickTransitionManager
27{
28public:
30 bool transitionLoaded();
31protected:
32 virtual void finished() override;
33private:
34 DAppLoaderPrivate *appLoader;
35};
36
40class DAppLoaderPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate, public QQuickItemChangeListener
41{
42 friend class DQmlComponentIncubator;
43public:
45 void ensureLoadPreload();
46 void ensureLoadMain();
47 void destoryIncubator(QQmlIncubator *incubator);
48 QQmlContext *creationContext(QQmlComponent *component, QObject *obj);
49 bool createObjects(const char *propertyName);
50 void createChildComponents();
51 void initRootItem(QQuickItem *item);
52 void updateRootItemSize(QQuickItem *item);
53 virtual void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override;
54 void findWindowContentItem();
55 void finishedLoaded();
56 void createOverlay();
57 void clearOverlay();
58 void _q_onPreloadCreated(QObject *obj, const QUrl &);
59 void _q_onMainComponentStatusChanged(QQmlComponent::Status status);
60 void _q_onComponentProgressChanged();
61
62 static QStringList buildinPluginPaths();
63
64 QString appid;
65 QStringList pluginPaths;
66 QQmlApplicationEngine *engine;
67 QList<QQmlIncubator *> incubators;
68 DQuickAppLoaderItem *appRootItem;
69 QQuickItem *loadingOverlay;
70 QPointer<QQuickItem> windowContentItem;
71 QQuickTransition *exitedTransition;
72 QQuickWindow *appWindow;
73 QQmlComponent *mainComponent;
74 bool overlayUsingParentSize;
75 bool duringTransition;
76 DWindowOverlayTransitionManager transitionManager;
77 QHash<QQmlComponent *, QQmlContext *> itemContextMap;
78 QScopedPointer<DQmlAppPreloadInterface> preloadInstance;
79 QScopedPointer<DQmlAppMainWindowInterface> mainInstance;
80 QScopedPointer<QGuiApplication> app;
81private:
82 template<class T> T *loadInstance() const;
83
84 D_DECLARE_PUBLIC(DAppLoader)
85};
86
87DQUICK_END_NAMESPACE
88
89#endif //DAPPLOADER_P_H
Definition dapploader_p.h:41
Definition dapploader.h:24
Definition dqmlappmainwindowinterface.h:21
Definition dqmlapppreloadinterface.h:22
Definition dapploader.cpp:61
Definition dquickapploaderitem_p.h:16