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
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_EXPORT QQmlInstantiator : public QObject, public QQmlParserStatus
28{
31
32 Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
33 Q_PROPERTY(bool asynchronous READ isAsync WRITE setAsync NOTIFY asynchronousChanged)
34 Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged)
35 Q_PROPERTY(int count READ count NOTIFY countChanged)
36 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
37 Q_PROPERTY(QObject *object READ object NOTIFY objectChanged)
38 Q_CLASSINFO("DefaultProperty", "delegate")
39 QML_NAMED_ELEMENT(Instantiator)
41
42public:
43 QQmlInstantiator(QObject *parent = nullptr);
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
54 QQmlComponent* delegate();
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
68 void modelChanged();
69 void delegateChanged();
70 void countChanged();
71 void objectChanged();
72 void activeChanged();
73 void asynchronousChanged();
74
75 void objectAdded(int index, QObject* object);
76 void objectRemoved(int index, QObject* object);
77
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:103
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set.
The QQmlComponent class encapsulates a QML component definition.
The QQmlParserStatus class provides updates on the QML parser state.
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
GLuint index
[2]
GLenum GLenum GLsizei count
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]