Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickloader_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKLOADER_P_H
6#define QQUICKLOADER_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20
22
24class QQmlComponent;
25
26class Q_QUICK_EXPORT QQuickLoader : public QQuickImplicitSizeItem
27{
28 Q_OBJECT
29
30 Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
31 Q_PROPERTY(QUrl source READ source WRITE setSourceWithoutResolve NOTIFY sourceChanged)
32 Q_PROPERTY(QQmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceComponentChanged)
33 Q_PROPERTY(QObject *item READ item NOTIFY itemChanged)
34 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
35 Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
36 Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
37 QML_NAMED_ELEMENT(Loader)
38 QML_ADDED_IN_VERSION(2, 0)
39
40public:
41 QQuickLoader(QQuickItem *parent = nullptr);
42 virtual ~QQuickLoader();
43
44 bool active() const;
45 void setActive(bool newVal);
46
47 Q_INVOKABLE void setSource(const QUrl &source, QJSValue initialProperties);
48 Q_INVOKABLE void setSource(const QUrl &source);
49
50 QUrl source() const;
51 void setSourceWithoutResolve(const QUrl &source);
52
53 QQmlComponent *sourceComponent() const;
54 void setSourceComponent(QQmlComponent *);
55 void resetSourceComponent();
56
57 enum Status { Null, Ready, Loading, Error };
58 Q_ENUM(Status)
59 Status status() const;
60 qreal progress() const;
61
62 bool asynchronous() const;
63 void setAsynchronous(bool a);
64
65 QObject *item() const;
66
67Q_SIGNALS:
68 void itemChanged();
69 void activeChanged();
70 void sourceChanged();
71 void sourceComponentChanged();
72 void statusChanged();
73 void progressChanged();
74 void loaded();
75 void asynchronousChanged();
76
77protected:
78 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
79 void componentComplete() override;
80 void itemChange(ItemChange change, const ItemChangeData &value) override;
81
82private:
83 QUrl setSourceUrlHelper(const QUrl &unresolvedUrl);
84 void setSource(const QUrl &sourceUrl, bool needsClear);
85 void loadFromSource();
86 void loadFromSourceComponent();
87 Q_DISABLE_COPY(QQuickLoader)
88 Q_DECLARE_PRIVATE(QQuickLoader)
89 Q_PRIVATE_SLOT(d_func(), void _q_sourceLoaded())
90 Q_PRIVATE_SLOT(d_func(), void _q_updateSize())
91};
92
93QT_END_NAMESPACE
94
95#endif // QQUICKLOADER_P_H
For specifying a pen used for drawing rectangle borders on a QQuickView.
\qmltype TextDocument \nativetype QQuickTextDocument \inqmlmodule QtQuick
Q_DECLARE_INTERFACE(QNetworkAccessBackendFactory, QNetworkAccessBackendFactory_iid)
static void qt_quickitems_defineModule()
#define QQuickTextInterface_iid