Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qqmlinstantiator_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 Research In Motion.
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 QQMLINSTANTIATOR_P_H
5#define QQMLINSTANTIATOR_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
18#include <QtQml/qqmlcomponent.h>
19#include <QtQml/qqmlparserstatus.h>
20#include <QtQmlModels/private/qtqmlmodelsglobal_p.h>
21
22QT_REQUIRE_CONFIG(qml_object_model);
23
25
27class Q_QMLMODELS_PRIVATE_EXPORT QQmlInstantiator : public QObject, public QQmlParserStatus
28{
31
32 Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged FINAL)
33 Q_PROPERTY(bool asynchronous READ isAsync WRITE setAsync NOTIFY asynchronousChanged FINAL)
34 Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged FINAL)
35 Q_PROPERTY(int count READ count NOTIFY countChanged FINAL)
36 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
37 Q_PROPERTY(QObject *object READ object NOTIFY objectChanged FINAL)
38 Q_CLASSINFO("DefaultProperty", "delegate")
39 QML_NAMED_ELEMENT(Instantiator)
41
42public:
45
46 bool isActive() const;
47 void setActive(bool newVal);
48
49 bool isAsync() const;
50 void setAsync(bool newVal);
51
52 int count() const;
53
55 void setDelegate(QQmlComponent* c);
56
57 QVariant model() const;
58 void setModel(const QVariant &v);
59
60 QObject *object() const;
61
62 Q_INVOKABLE QObject *objectAt(int index) const;
63
64 void classBegin() override;
65 void componentComplete() override;
66
74
75 void objectAdded(int index, QObject* object);
76 void objectRemoved(int index, QObject* object);
77
78private:
79 Q_DISABLE_COPY(QQmlInstantiator)
80 Q_DECLARE_PRIVATE(QQmlInstantiator)
81 Q_PRIVATE_SLOT(d_func(), void _q_createdItem(int, QObject *))
82 Q_PRIVATE_SLOT(d_func(), void _q_modelUpdated(const QQmlChangeSet &, bool))
83};
84
86
87#endif // QQMLCREATOR_P_H
bool isActive
\inmodule QtCore
Definition qobject.h:90
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set.
The QQmlComponent class encapsulates a QML component definition.
void objectRemoved(int index, QObject *object)
QQmlComponent * delegate()
void objectAdded(int index, QObject *object)
void asynchronousChanged()
void delegateChanged()
The QQmlParserStatus class provides updates on the QML parser state.
virtual void classBegin()=0
Invoked after class creation, but before any properties have been set.
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
\inmodule QtCore
Definition qvariant.h:64
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
GLuint index
[2]
GLenum GLenum GLsizei count
GLuint object
[3]
const GLubyte * c
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
#define Q_INVOKABLE
#define Q_INTERFACES(x)
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS
view setModel(model)
[17] //! [18]
QSqlQueryModel * model
[16]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent