4#ifndef QQMLDMABSTRACTITEMMODELDATA_P_H
5#define QQMLDMABSTRACTITEMMODELDATA_P_H
18#include <private/qqmladaptormodelenginedata_p.h>
19#include <private/qqmldelegatemodel_p_p.h>
20#include <private/qobject_p.h>
41 QV4::ReturnedValue
get() override;
46 const
QV4::FunctionObject *
b, const
QV4::Value *thisObject,
47 const
QV4::Value *argv,
int argc);
49 const
QV4::FunctionObject *
b, const
QV4::Value *thisObject,
50 const
QV4::Value *argv,
int argc);
53 const
QV4::FunctionObject *
b, const
QV4::Value *thisObject,
54 const
QV4::Value *argv,
int argc);
56 const
QV4::FunctionObject *
b, const
QV4::Value *thisObject,
57 const
QV4::Value *argv,
int argc);
72 QVector<QVariant> m_cachedData;
90 const QList<QQmlDelegateModelItem *> &
items,
93 const QVector<int> &roles)
const override
101 roleIds <<
it.value();
106 QVector<int> signalIndexes;
107 for (
int i = 0;
i < roles.size(); ++
i) {
108 const int role = roles.at(
i);
113 if (propertyId != -1)
116 if (roles.isEmpty()) {
118 signalIndexes.reserve(propertyRolesCount);
119 for (
int propertyId = 0; propertyId < propertyRolesCount; ++propertyId)
123 QVarLengthArray<QQmlGuard<QQmlDMAbstractItemModelData>> guardedItems;
129 for (
const auto &
item : std::as_const(guardedItems)) {
133 const int idx =
item->modelIndex();
135 for (
int i = 0;
i < signalIndexes.size(); ++
i)
146 const QList<QByteArray> &newRoles)
const override
152 dataType->watchedRoles.removeOne(oldRole);
153 dataType->watchedRoles += newRoles;
165 if (
o->d()->item->index >= 0) {
298 const QQmlRefPointer<QQmlDelegateModelItemMetaType> &
metaType,
309 QQmlAdaptorModelEngineData::setModelDataType<QQmlDMAbstractItemModelData>(&builder,
this);
313 const QHash<int, QByteArray>
names = aim ? aim->
roleNames() : QHash<int, QByteArray>();
virtual QHash< int, QByteArray > roleNames() const
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
qsizetype size() const noexcept
Returns the number of items in the hash.
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
qsizetype size() const noexcept
bool isEmpty() const noexcept
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
static void addProperty(QMetaObjectBuilder *builder, int propertyId, const QByteArray &propertyName, const QByteArray &propertyType)
static QV4::ReturnedValue get_index(const QV4::FunctionObject *f, const QV4::Value *thisObject, const QV4::Value *, int)
QQmlPropertyCache::ConstPtr propertyCache
QScopedPointer< QMetaObject, QScopedPointerPodDeleter > metaObject
QAbstractItemModel * aim()
int rowAt(int index) const
QTypeRevision modelItemRevision
int columnAt(int index) const
QPersistentModelIndex rootIndex
int metaCall(QMetaObject::Call call, int id, void **arguments)
static QV4::ReturnedValue get_modelData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
void setValue(const QString &role, const QVariant &value) override
static QV4::ReturnedValue get_property(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
QV4::ReturnedValue get() override
static QV4::ReturnedValue set_property(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
void setModelData(const QVariant &modelData)
bool resolveIndex(const QQmlAdaptorModel &model, int idx) override
static QV4::ReturnedValue set_modelData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
QQmlRefPointer< QQmlDelegateModelItemMetaType > const metaType
static Ptr createStandalone(const QMetaObject *, QTypeRevision metaObjectRevision=QTypeRevision::zero())
Creates a standalone QQmlPropertyCache of metaObject.
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray toUtf8() const &
ObjectType::Data * allocate(Args &&... args)
void set(ExecutionEngine *engine, const Value &value)
void * data()
Returns a pointer to the contained object as a generic void* that can be written to.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
QVariant parentModelIndex(const QQmlAdaptorModel &model) const override
void cleanup(QQmlAdaptorModel &) const override
int columnCount(const QQmlAdaptorModel &model) const override
QList< int > propertyRoles
QV4::PersistentValue prototype
QList< QByteArray > watchedRoles
QHash< QByteArray, int > roleNames
bool notify(const QQmlAdaptorModel &, const QList< QQmlDelegateModelItem * > &items, int index, int count, const QVector< int > &roles) const override
QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const override
static QV4::ReturnedValue get_hasModelChildren(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int)
int rowCount(const QQmlAdaptorModel &model) const override
bool canFetchMore(const QQmlAdaptorModel &model) const override
int metaCall(QObject *object, QMetaObject::Call call, int id, void **arguments) override
void initializeConstructor(QQmlAdaptorModelEngineData *const data)
void objectDestroyed(QObject *) override
void initializeMetaType(const QQmlAdaptorModel &model)
VDMAbstractItemModelDataType(QQmlAdaptorModel *model)
QList< int > watchedRoleIds
void fetchMore(QQmlAdaptorModel &model) const override
QVariant modelIndex(const QQmlAdaptorModel &model, int index) const override
void replaceWatchedRoles(QQmlAdaptorModel &, const QList< QByteArray > &oldRoles, const QList< QByteArray > &newRoles) const override
QQmlDelegateModelItem * createItem(QQmlAdaptorModel &model, const QQmlRefPointer< QQmlDelegateModelItemMetaType > &metaType, int index, int row, int column) override
QSet< QString >::iterator it
QList< QVariant > arguments
Combined button and popup list for selecting options.
Scoped< FunctionObject > ScopedFunctionObject
Scoped< String > ScopedString
#define QByteArrayLiteral(str)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define QT_ANONYMOUS_PROPERTY(...)
GLboolean GLboolean GLboolean b
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
static const int oldRoles[7]
QLatin1StringView QLatin1String
#define QStringLiteral(str)
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
bool contains(const AT &t) const noexcept
MemoryManager * memoryManager
Heap::Object * newObject()
Heap::String * newString(char16_t c)
ReturnedValue throwTypeError()
void defineAccessorProperty(const QString &name, VTable::Call getter, VTable::Call setter)
void insertMember(StringOrSymbol *s, const Value &v, PropertyAttributes attributes=Attr_Data)