Qt 6.x
The Qt SDK
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 QQmlV4Function;
24class Q_QUICK_PRIVATE_EXPORT QQuickLoader : public QQuickImplicitSizeItem
25{
27
28 Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged FINAL)
29 Q_PROPERTY(QUrl source READ source WRITE setSourceWithoutResolve NOTIFY sourceChanged FINAL)
30 Q_PROPERTY(QQmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceComponentChanged FINAL)
31 Q_PROPERTY(QObject *item READ item NOTIFY itemChanged FINAL)
32 Q_PROPERTY(Status status READ status NOTIFY statusChanged FINAL)
33 Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged FINAL)
34 Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged FINAL)
35 QML_NAMED_ELEMENT(Loader)
37
38public:
39 QQuickLoader(QQuickItem *parent = nullptr);
40 virtual ~QQuickLoader();
41
42 bool active() const;
43 void setActive(bool newVal);
44
45 Q_INVOKABLE void setSource(const QUrl &source, QJSValue initialProperties);
46 Q_INVOKABLE void setSource(const QUrl &source);
47
48 QUrl source() const;
49 void setSourceWithoutResolve(const QUrl &source);
50
51 QQmlComponent *sourceComponent() const;
52 void setSourceComponent(QQmlComponent *);
53 void resetSourceComponent();
54
55 enum Status { Null, Ready, Loading, Error };
56 Q_ENUM(Status)
57 Status status() const;
58 qreal progress() const;
59
60 bool asynchronous() const;
61 void setAsynchronous(bool a);
62
63 QObject *item() const;
64
72 void loaded();
74
75protected:
76 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
77 void componentComplete() override;
78 void itemChange(ItemChange change, const ItemChangeData &value) override;
79
80private:
81 QUrl setSourceUrlHelper(const QUrl &unresolvedUrl);
82 void setSource(const QUrl &sourceUrl, bool needsClear);
83 void loadFromSource();
84 void loadFromSourceComponent();
85 Q_DISABLE_COPY(QQuickLoader)
86 Q_DECLARE_PRIVATE(QQuickLoader)
87 Q_PRIVATE_SLOT(d_func(), void _q_sourceLoaded())
88 Q_PRIVATE_SLOT(d_func(), void _q_updateSize())
89};
90
92
94
95#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:90
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:64
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
virtual void itemChange(ItemChange, const ItemChangeData &)
Called when change occurs for this item.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
Definition qquickitem.h:143
void activeChanged()
void itemChanged()
void statusChanged()
void progressChanged()
void sourceChanged()
void asynchronousChanged()
void sourceComponentChanged()
\inmodule QtCore\reentrant
Definition qrect.h:483
\inmodule QtCore
Definition qurl.h:94
void statusChanged(QDeclarativeComponent::Status status)
[1]
Definition qlogging.cpp:9
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_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#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:92
QGraphicsItem * item
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
\inmodule QtQuick
Definition qquickitem.h:158