| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 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 QQUICKVIEW_P_H |
| 5 | #define QQUICKVIEW_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include "qquickview.h" |
| 19 | |
| 20 | #include <QtCore/qurl.h> |
| 21 | #include <QtCore/qelapsedtimer.h> |
| 22 | #include <QtCore/qtimer.h> |
| 23 | #include <QtCore/qpointer.h> |
| 24 | #include <QtCore/QWeakPointer> |
| 25 | |
| 26 | #include <QtQml/qqmlengine.h> |
| 27 | #include "qquickwindow_p.h" |
| 28 | |
| 29 | #include "qquickitemchangelistener_p.h" |
| 30 | |
| 31 | QT_BEGIN_NAMESPACE |
| 32 | |
| 33 | class QQmlContext; |
| 34 | class QQmlError; |
| 35 | class QQuickItem; |
| 36 | class QQmlComponent; |
| 37 | |
| 38 | class Q_QUICK_EXPORT QQuickViewPrivate : public QQuickWindowPrivate, |
| 39 | public QQuickItemChangeListener |
| 40 | { |
| 41 | Q_DECLARE_PUBLIC(QQuickView) |
| 42 | public: |
| 43 | static QQuickViewPrivate* get(QQuickView *view) { return view->d_func(); } |
| 44 | static const QQuickViewPrivate* get(const QQuickView *view) { return view->d_func(); } |
| 45 | |
| 46 | QQuickViewPrivate(); |
| 47 | ~QQuickViewPrivate(); |
| 48 | |
| 49 | enum ExecuteState { Continue, Stop }; |
| 50 | ExecuteState executeHelper(); |
| 51 | void execute(); |
| 52 | void execute(QAnyStringView uri, QAnyStringView typeName); |
| 53 | void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override; |
| 54 | void initResize(); |
| 55 | void updateSize(); |
| 56 | bool setRootObject(QObject *); |
| 57 | |
| 58 | void init(QQmlEngine* e = nullptr); |
| 59 | |
| 60 | QSize rootObjectSize() const; |
| 61 | |
| 62 | QPointer<QQuickItem> root; |
| 63 | |
| 64 | QUrl source; |
| 65 | |
| 66 | QPointer<QQmlEngine> engine; |
| 67 | QQmlComponent *component; |
| 68 | QBasicTimer resizetimer; |
| 69 | |
| 70 | QQuickView::ResizeMode resizeMode; |
| 71 | QSize initialSize; |
| 72 | QElapsedTimer frameTimer; |
| 73 | |
| 74 | QVariantMap initialProperties; |
| 75 | }; |
| 76 | |
| 77 | QT_END_NAMESPACE |
| 78 | |
| 79 | #endif // QQUICKVIEW_P_H |
| 80 |
