Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
ListModel Class Reference

#include <qqmllistmodel_p_p.h>

Collaboration diagram for ListModel:

Public Types

enum class  SetElement { WasJustInserted , IsCurrentlyUpdated }

Public Member Functions

 ListModel (ListLayout *layout, QQmlListModel *modelCache)
void destroy ()
int setOrCreateProperty (int elementIndex, const QString &key, const QVariant &data)
int setExistingProperty (int uid, const QString &key, const QV4::Value &data, QV4::ExecutionEngine *eng)
QVariant getProperty (int elementIndex, int roleIndex, const QQmlListModel *owner, QV4::ExecutionEngine *eng)
ListModelgetListProperty (int elementIndex, const ListLayout::Role &role)
void updateTranslations ()
int roleCount () const
const ListLayout::RolegetExistingRole (int index) const
const ListLayout::RolegetExistingRole (QV4::String *key) const
const ListLayout::RolegetOrCreateListRole (const QString &name)
int elementCount () const
void set (int elementIndex, QV4::Object *object, QVector< int > *roles)
void set (int elementIndex, QV4::Object *object, SetElement reason=SetElement::IsCurrentlyUpdated)
int append (QV4::Object *object)
void insert (int elementIndex, QV4::Object *object)
Q_REQUIRED_RESULT QVector< std::function< void()> > remove (int index, int count)
int appendElement ()
void insertElement (int index)
void move (int from, int to, int n)
QObjectgetOrCreateModelObject (QQmlListModel *model, int elementIndex)

Static Public Member Functions

static bool sync (ListModel *src, ListModel *target)

Friends

class ListElement
class QQmlListModelWorkerAgent
class QQmlListModelParser

Detailed Description

Definition at line 327 of file qqmllistmodel_p_p.h.

Member Enumeration Documentation

◆ SetElement

enum class ListModel::SetElement
strong
Enumerator
WasJustInserted 
IsCurrentlyUpdated 

Definition at line 368 of file qqmllistmodel_p_p.h.

Constructor & Destructor Documentation

◆ ListModel()

ListModel::ListModel ( ListLayout * layout,
QQmlListModel * modelCache )

Definition at line 476 of file qqmllistmodel.cpp.

Member Function Documentation

◆ append()

int ListModel::append ( QV4::Object * object)

Definition at line 765 of file qqmllistmodel.cpp.

References appendElement().

Here is the call graph for this function:

◆ appendElement()

int ListModel::appendElement ( )

Definition at line 491 of file qqmllistmodel.cpp.

Referenced by append().

Here is the caller graph for this function:

◆ destroy()

void ListModel::destroy ( )

Definition at line 480 of file qqmllistmodel.cpp.

◆ elementCount()

int ListModel::elementCount ( ) const
inline

Definition at line 363 of file qqmllistmodel_p_p.h.

◆ getExistingRole() [1/2]

const ListLayout::Role & ListModel::getExistingRole ( int index) const
inline

Definition at line 348 of file qqmllistmodel_p_p.h.

References ListLayout::getExistingRole().

Referenced by QV4::ModelObjectOwnPropertyKeyIterator::next().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getExistingRole() [2/2]

const ListLayout::Role * ListModel::getExistingRole ( QV4::String * key) const
inline

Definition at line 353 of file qqmllistmodel_p_p.h.

References ListLayout::getExistingRole().

Here is the call graph for this function:

◆ getListProperty()

ListModel * ListModel::getListProperty ( int elementIndex,
const ListLayout::Role & role )

Definition at line 555 of file qqmllistmodel.cpp.

◆ getOrCreateListRole()

const ListLayout::Role & ListModel::getOrCreateListRole ( const QString & name)
inline

Definition at line 358 of file qqmllistmodel_p_p.h.

References ListLayout::Role::List.

◆ getOrCreateModelObject()

QObject * ListModel::getOrCreateModelObject ( QQmlListModel * model,
int elementIndex )

Definition at line 319 of file qqmllistmodel.cpp.

◆ getProperty()

QVariant ListModel::getProperty ( int elementIndex,
int roleIndex,
const QQmlListModel * owner,
QV4::ExecutionEngine * eng )

Definition at line 546 of file qqmllistmodel.cpp.

References ListLayout::getExistingRole(), and ListLayout::roleCount().

Here is the call graph for this function:

◆ insert()

void ListModel::insert ( int elementIndex,
QV4::Object * object )

Definition at line 759 of file qqmllistmodel.cpp.

References insertElement().

Here is the call graph for this function:

◆ insertElement()

void ListModel::insertElement ( int index)

Definition at line 498 of file qqmllistmodel.cpp.

Referenced by insert().

Here is the caller graph for this function:

◆ move()

void ListModel::move ( int from,
int to,
int n )

Definition at line 504 of file qqmllistmodel.cpp.

◆ remove()

QVector< std::function< void()> > ListModel::remove ( int index,
int count )

Definition at line 743 of file qqmllistmodel.cpp.

◆ roleCount()

int ListModel::roleCount ( ) const
inline

Definition at line 343 of file qqmllistmodel_p_p.h.

References ListLayout::roleCount().

Referenced by QV4::ModelObjectOwnPropertyKeyIterator::next().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [1/2]

void ListModel::set ( int elementIndex,
QV4::Object * object,
QVector< int > * roles )

Definition at line 572 of file qqmllistmodel.cpp.

References ListLayout::Role::type, ModelNodeMetaObject::updateValues(), and ListLayout::Role::VariantMap.

Here is the call graph for this function:

◆ set() [2/2]

◆ setExistingProperty()

int ListModel::setExistingProperty ( int uid,
const QString & key,
const QV4::Value & data,
QV4::ExecutionEngine * eng )

Definition at line 793 of file qqmllistmodel.cpp.

References ListLayout::getExistingRole().

Here is the call graph for this function:

◆ setOrCreateProperty()

int ListModel::setOrCreateProperty ( int elementIndex,
const QString & key,
const QVariant & data )

Definition at line 772 of file qqmllistmodel.cpp.

References ModelNodeMetaObject::updateValues().

Here is the call graph for this function:

◆ sync()

bool ListModel::sync ( ListModel * src,
ListModel * target )
static

Definition at line 337 of file qqmllistmodel.cpp.

References ListElement::ListElement(), ListLayout::sync(), and ModelNodeMetaObject::updateValues().

Referenced by QQmlListModelWorkerAgent::event(), and ListElement::sync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTranslations()

void ListModel::updateTranslations ( )

Definition at line 561 of file qqmllistmodel.cpp.

References ModelNodeMetaObject::updateValues().

Here is the call graph for this function:

◆ ListElement

friend class ListElement
friend

Definition at line 436 of file qqmllistmodel_p_p.h.

◆ QQmlListModelParser

friend class QQmlListModelParser
friend

Definition at line 438 of file qqmllistmodel_p_p.h.

◆ QQmlListModelWorkerAgent

friend class QQmlListModelWorkerAgent
friend

Definition at line 437 of file qqmllistmodel_p_p.h.


The documentation for this class was generated from the following files: