6#include <QtCore/qcoreapplication.h>
7#include <QtQml/qqmlcontext.h>
8#include <QtQml/qqmlengine.h>
9#include <QtQml/qqmlinfo.h>
11#include <private/qqmlchangeset_p.h>
12#include <private/qqmlglobal_p.h>
13#include <private/qobject_p.h>
14#include <private/qpodvector_p.h>
16#include <QtCore/qhash.h>
17#include <QtCore/qlist.h>
76 emit q->modelUpdated(changeSet,
false);
77 emit q->countChanged();
78 emit q->childrenChanged();
84 attached->setIndex(-1);
89 emit q->modelUpdated(changeSet,
false);
90 emit q->childrenChanged();
93 void move(
int from,
int to,
int n) {
105 for (
int i = 0;
i < to - from; ++
i)
107 for (
int i = 0;
i <
n; ++
i)
110 for (
int i = 0;
i < store.
count(); ++
i) {
118 emit q->modelUpdated(changeSet,
false);
119 emit q->childrenChanged();
135 emit q->modelUpdated(changeSet,
false);
136 emit q->countChanged();
137 emit q->childrenChanged();
234 return d->children.size();
257 int idx =
d->indexOf(
item);
259 if (!
d->children[idx].deref())
268 if (index < 0 || index >=
d->children.size())
281 return d->indexOf(
item);
311 if (index < 0 || index >=
d->children.size())
313 return d->children.at(
index).item;
328void QQmlObjectModel::append(
QObject *
object)
331 d->insert(
count(),
object);
352 if (index < 0 || index >
count()) {
374void QQmlObjectModel::move(
int from,
int to,
int n)
377 if (
n <= 0 || from ==
to)
379 if (from < 0 || to < 0 || from + n >
count() ||
to +
n >
count()) {
383 d->move(from,
to,
n);
394void QQmlObjectModel::remove(
int index,
int n)
397 if (
index < 0 || n <= 0 || index + n >
count()) {
412void QQmlObjectModel::clear()
425 Q_UNREACHABLE_RETURN(
false);
430#include "moc_qqmlobjectmodel_p.cpp"
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set.
void remove(int index, int count)
Appends a notification that count items were removed at index.
void change(int index, int count)
Appends a notification that count items were changed at index.
void move(int from, int to, int count, int moveId)
Appends a notification that count items were moved from one index to another.
void insert(int index, int count)
Appends a notification that count items were inserted at index.
IncubationMode
Specifies the mode the incubator operates in.
Status
Specifies the status of the QQmlIncubator.
void createdItem(int index, QObject *object)
virtual bool setRequiredProperty(int index, const QString &name, const QVariant &value)
void initItem(int index, QObject *object)
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
static QHash< QObject *, QQmlObjectModelAttached * > attachedProperties
static QQmlObjectModelAttached * properties(QObject *obj)
static void children_replace(QQmlListProperty< QObject > *prop, qsizetype index, QObject *item)
static QObject * children_at(QQmlListProperty< QObject > *prop, qsizetype index)
int indexOf(QObject *item) const
void move(int from, int to, int n)
void replace(int index, QObject *item)
static void children_append(QQmlListProperty< QObject > *prop, QObject *item)
static void children_clear(QQmlListProperty< QObject > *prop)
static qsizetype children_count(QQmlListProperty< QObject > *prop)
static void children_removeLast(QQmlListProperty< QObject > *prop)
void insert(int index, QObject *item)
void remove(int index, int n)
QQmlListProperty< QObject > children
\qmlattachedproperty int QtQml.Models::ObjectModel::index This attached property holds the index of t...
static QQmlObjectModelAttached * qmlAttachedProperties(QObject *obj)
int count() const override
\qmlproperty int QtQml.Models::ObjectModel::count
QVariant variantValue(int index, const QString &role) override
QQmlObjectModel(QObject *parent=nullptr)
\qmltype ObjectModel \instantiates QQmlObjectModel \inqmlmodule QtQml.Models
QQmlIncubator::Status incubationStatus(int index) override
bool isValid() const override
ReleaseFlags release(QObject *object, ReusableFlag reusable=NotReusable) override
int indexOf(QObject *object, QObject *objectContext) const override
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toUtf8() const &
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLdouble GLdouble GLdouble GLdouble q
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent