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
31QT_BEGIN_NAMESPACE
32
33class QQmlContext;
34class QQmlError;
35class QQuickItem;
36class QQmlComponent;
37
38class Q_QUICK_PRIVATE_EXPORT QQuickViewPrivate : public QQuickWindowPrivate,
39 public QQuickItemChangeListener
40{
41 Q_DECLARE_PUBLIC(QQuickView)
42public:
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 void execute();
50 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override;
51 void initResize();
52 void updateSize();
53 bool setRootObject(QObject *);
54
55 void init(QQmlEngine* e = nullptr);
56
57 QSize rootObjectSize() const;
58
59 QPointer<QQuickItem> root;
60
61 QUrl source;
62
63 QPointer<QQmlEngine> engine;
64 QQmlComponent *component;
65 QBasicTimer resizetimer;
66
67 QQuickView::ResizeMode resizeMode;
68 QSize initialSize;
69 QElapsedTimer frameTimer;
70
71 QVariantMap initialProperties;
72};
73
74QT_END_NAMESPACE
75
76#endif // QQUICKVIEW_P_H
77

source code of qtdeclarative/src/quick/items/qquickview_p.h