Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qqmllistmodelworkeragent_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 QQUICKLISTMODELWORKERAGENT_P_H
5#define QQUICKLISTMODELWORKERAGENT_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 <qtqmlmodelsglobal_p.h>
19
20#include <QEvent>
21#include <QMutex>
22#include <QWaitCondition>
23#include <QtQml/qqml.h>
24
25#include <private/qv4engine_p.h>
26
27QT_REQUIRE_CONFIG(qml_list_model);
28
30
31
32class QQmlListModel;
33
35{
37 Q_PROPERTY(int count READ count FINAL)
41
42public:
45
48
49 Q_INVOKABLE void addref();
50 Q_INVOKABLE void release();
51
52 int count() const;
53
54 Q_INVOKABLE void clear();
58 Q_INVOKABLE QJSValue get(int index) const;
59 Q_INVOKABLE void set(int index, const QJSValue &value);
60 Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value);
61 Q_INVOKABLE void move(int from, int to, int count);
62 Q_INVOKABLE void sync();
63
64 void modelDestroyed();
65
68
69protected:
70 bool event(QEvent *) override;
71
72private:
74 friend class QQmlListModel;
75
76 struct Sync : public QEvent {
77 Sync(QQmlListModel *l)
79 , list(l)
80 {}
81 ~Sync();
83 };
84
85 QAtomicInt m_ref;
86 QQmlListModel *m_orig;
87 QQmlListModel *m_copy;
88 QMutex mutex;
89 QWaitCondition syncDone;
90};
91
93
94#endif // QQUICKLISTMODELWORKERAGENT_P_H
95
\inmodule QtCore
Definition qatomic.h:112
\inmodule QtCore
Definition qcoreevent.h:45
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
\inmodule QtCore
Definition qmutex.h:285
\inmodule QtCore
Definition qobject.h:90
Q_INVOKABLE void append(QQmlV4Function *args)
void engineChanged(QV4::ExecutionEngine *engine)
Q_INVOKABLE void move(int from, int to, int count)
Q_INVOKABLE void remove(QQmlV4Function *args)
Q_INVOKABLE void setProperty(int index, const QString &property, const QVariant &value)
void setEngine(QV4::ExecutionEngine *eng)
Q_INVOKABLE void insert(QQmlV4Function *args)
Q_INVOKABLE QJSValue get(int index) const
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qvariant.h:64
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint index
[2]
GLenum GLenum GLsizei count
struct _cl_event * event
#define QML_ANONYMOUS
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_SIGNALS
const char property[13]
Definition qwizard.cpp:101
QList< int > list
[14]
QFuture< QSet< QChar > > set
[10]
QJSValueList args