1// Copyright (C) 2015 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 QQUICKVIEWCONTROLLER_H
5#define QQUICKVIEWCONTROLLER_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 <QtWebViewQuick/private/qtwebviewquickglobal_p.h>
19#include <QtQuick/QQuickItem>
20#include <QtGui/qwindow.h>
21
22QT_BEGIN_NAMESPACE
23
24class QNativeViewController;
25class QQuickViewChangeListener;
26
27class Q_WEBVIEWQUICK_EXPORT QQuickViewController : public QQuickItem
28{
29 Q_OBJECT
30public:
31 explicit QQuickViewController(QQuickItem *parent = nullptr);
32 ~QQuickViewController();
33
34public Q_SLOTS:
35 void onWindowChanged(QQuickWindow *window);
36 void onVisibleChanged();
37
38protected:
39 void componentComplete() override;
40 void updatePolish() override;
41 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
42 void setView(QNativeViewController *view);
43
44private:
45 friend class QQuickWebView;
46 QNativeViewController *m_view;
47 QScopedPointer<QQuickViewChangeListener> m_changeListener;
48
49private Q_SLOTS:
50 void scheduleUpdatePolish();
51 void onSceneGraphInvalidated();
52};
53
54QT_END_NAMESPACE
55
56#endif // QTWINDOWCONTROLLERITEM_H
57

source code of qtwebview/src/quick/qquickviewcontroller_p.h