1// qquickview.sip generated by MetaSIP
2//
3// This file is part of the QtQuick Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QQuickView : QQuickWindow /ExportDerived/
24{
25%TypeHeaderCode
26#include <qquickview.h>
27%End
28
29public:
30    explicit QQuickView(QWindow *parent /TransferThis/ = 0);
31    QQuickView(QQmlEngine *engine, QWindow *parent /TransferThis/);
32    QQuickView(const QUrl &source, QWindow *parent /TransferThis/ = 0);
33    virtual ~QQuickView() /ReleaseGIL/;
34    QUrl source() const;
35    QQmlEngine *engine() const;
36    QQmlContext *rootContext() const;
37    QQuickItem *rootObject() const;
38
39    enum ResizeMode
40    {
41        SizeViewToRootObject,
42        SizeRootObjectToView,
43    };
44
45    QQuickView::ResizeMode resizeMode() const;
46    void setResizeMode(QQuickView::ResizeMode);
47
48    enum Status
49    {
50        Null,
51        Ready,
52        Loading,
53        Error,
54    };
55
56    QQuickView::Status status() const;
57    QList<QQmlError> errors() const;
58    QSize initialSize() const;
59
60public slots:
61    void setSource(const QUrl &) /ReleaseGIL/;
62%If (Qt_5_14_0 -)
63    void setInitialProperties(const QVariantMap &initialProperties);
64%End
65
66signals:
67    void statusChanged(QQuickView::Status);
68
69protected:
70    virtual void resizeEvent(QResizeEvent *);
71    virtual void timerEvent(QTimerEvent *);
72    virtual void keyPressEvent(QKeyEvent *);
73    virtual void keyReleaseEvent(QKeyEvent *);
74    virtual void mousePressEvent(QMouseEvent *);
75    virtual void mouseReleaseEvent(QMouseEvent *);
76    virtual void mouseMoveEvent(QMouseEvent *);
77};
78