Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QQUICKLOADER_P_H
5#define QQUICKLOADER_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
19
21
23class Q_QUICK_EXPORT QQuickLoader : public QQuickImplicitSizeItem
24{
26
27 Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
28 Q_PROPERTY(QUrl source READ source WRITE setSourceWithoutResolve NOTIFY sourceChanged)
29 Q_PROPERTY(QQmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceComponentChanged)
30 Q_PROPERTY(QObject *item READ item NOTIFY itemChanged)
31 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
32 Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
33 Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
34 QML_NAMED_ELEMENT(Loader)
36
37public:
38 QQuickLoader(QQuickItem *parent = nullptr);
39 virtual ~QQuickLoader();
40
41 bool active() const;
42 void setActive(bool newVal);
43
44 Q_INVOKABLE void setSource(const QUrl &source, QJSValue initialProperties);
45 Q_INVOKABLE void setSource(const QUrl &source);
46
47 QUrl source() const;
48 void setSourceWithoutResolve(const QUrl &source);
49
50 QQmlComponent *sourceComponent() const;
51 void setSourceComponent(QQmlComponent *);
52 void resetSourceComponent();
53
54 enum Status { Null, Ready, Loading, Error };
55 Q_ENUM(Status)
56 Status status() const;
57 qreal progress() const;
58
59 bool asynchronous() const;
60 void setAsynchronous(bool a);
61
62 QObject *item() const;
63
71 void loaded();
73
74protected:
75 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
76 void componentComplete() override;
77 void itemChange(ItemChange change, const ItemChangeData &value) override;
78
79private:
80 QUrl setSourceUrlHelper(const QUrl &unresolvedUrl);
81 void setSource(const QUrl &sourceUrl, bool needsClear);
82 void loadFromSource();
83 void loadFromSourceComponent();
84 Q_DISABLE_COPY(QQuickLoader)
85 Q_DECLARE_PRIVATE(QQuickLoader)
86 Q_PRIVATE_SLOT(d_func(), void _q_sourceLoaded())
87 Q_PRIVATE_SLOT(d_func(), void _q_updateSize())
88};
89
91
92#endif // QQUICKLOADER_P_H
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
\inmodule QtCore
Definition qobject.h:103
The QQmlComponent class encapsulates a QML component definition.
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
Definition qquickitem.h:144
void activeChanged()
void itemChanged()
void statusChanged()
void progressChanged()
void sourceChanged()
void asynchronousChanged()
void sourceComponentChanged()
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore
Definition qurl.h:94
void statusChanged(QQmlComponent::Status status)
[1]
Definition qlogging.cpp:11
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLsizei GLsizei GLchar * source
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
QGraphicsItem * item
\inmodule QtQuick
Definition qquickitem.h:159