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
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)
 
 ~ListModel ()
 
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 314 of file qqmllistmodel_p_p.h.

Member Enumeration Documentation

◆ SetElement

enum class ListModel::SetElement
strong
Enumerator
WasJustInserted 
IsCurrentlyUpdated 

Definition at line 356 of file qqmllistmodel_p_p.h.

Constructor & Destructor Documentation

◆ ListModel()

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

Definition at line 475 of file qqmllistmodel.cpp.

Referenced by set().

+ Here is the caller graph for this function:

◆ ~ListModel()

ListModel::~ListModel ( )
inline

Definition at line 319 of file qqmllistmodel_p_p.h.

Member Function Documentation

◆ append()

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

Definition at line 765 of file qqmllistmodel.cpp.

References appendElement(), set, and WasJustInserted.

Referenced by QQmlListModel::append().

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

◆ appendElement()

int ListModel::appendElement ( )

Definition at line 490 of file qqmllistmodel.cpp.

References QPODVector< T, Increment >::count().

Referenced by append().

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

◆ destroy()

void ListModel::destroy ( )

Definition at line 479 of file qqmllistmodel.cpp.

References QPODVector< T, Increment >::count(), and remove().

Referenced by QQmlListModel::~QQmlListModel().

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

◆ elementCount()

int ListModel::elementCount ( ) const
inline

Definition at line 351 of file qqmllistmodel_p_p.h.

References QPODVector< T, Increment >::count().

Referenced by QQmlListModel::append(), and QQmlListModel::count().

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

◆ getExistingRole() [1/2]

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

Definition at line 336 of file qqmllistmodel_p_p.h.

References ListLayout::getExistingRole().

Referenced by QQmlListModel::roleNames(), QQmlListModel::setData(), ModelNodeMetaObject::updateValues(), and ModelNodeMetaObject::updateValues().

+ 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 341 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 554 of file qqmllistmodel.cpp.

Referenced by ListElement::sync().

+ Here is the caller graph for this function:

◆ getOrCreateListRole()

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

Definition at line 346 of file qqmllistmodel_p_p.h.

References ListLayout::getRoleOrCreate(), and ListLayout::Role::List.

+ Here is the call graph for this function:

◆ getOrCreateModelObject()

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

Definition at line 318 of file qqmllistmodel.cpp.

References QQmlData::DoesNotOwnMemory, elements, QObjectPrivate::get(), model, Q_ASSERT, and void.

Referenced by QQmlListModel::get().

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

◆ getProperty()

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

Definition at line 545 of file qqmllistmodel.cpp.

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

Referenced by QQmlListModel::data().

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

◆ insert()

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

Definition at line 759 of file qqmllistmodel.cpp.

References insertElement(), set, and WasJustInserted.

Referenced by QQmlListModel::insert(), and QQmlListModel::set().

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

◆ insertElement()

void ListModel::insertElement ( int index)

Definition at line 497 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 503 of file qqmllistmodel.cpp.

References i.

Referenced by QQmlListModel::move().

+ Here is the caller graph for this function:

◆ remove()

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

Definition at line 743 of file qqmllistmodel.cpp.

References QPODVector< T, Increment >::append(), i, layout, QPODVector< T, Increment >::remove(), and void.

Referenced by destroy().

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

◆ roleCount()

int ListModel::roleCount ( ) const
inline

Definition at line 331 of file qqmllistmodel_p_p.h.

References ListLayout::roleCount().

Referenced by QQmlListModel::roleNames(), and ModelNodeMetaObject::updateValues().

+ 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 )

◆ 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 QPODVector< T, Increment >::count(), and ListLayout::getExistingRole().

Referenced by ModelNodeMetaObject::propertyWritten().

+ Here is the call graph for this function:
+ Here is the caller 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 cache, QPODVector< T, Increment >::count(), and ListLayout::getRoleOrCreate().

Referenced by QQmlListModel::setData(), and QQmlListModel::setProperty().

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

◆ sync()

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

Definition at line 336 of file qqmllistmodel.cpp.

References QSet< T >::end(), QSet< T >::find(), i, it, j, mo, Q_ASSERT, ListElement::sync(), and ListLayout::sync().

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 560 of file qqmllistmodel.cpp.

References cache, and QPODVector< T, Increment >::count().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ ListElement

friend class ListElement
friend

Definition at line 411 of file qqmllistmodel_p_p.h.

◆ QQmlListModelParser

friend class QQmlListModelParser
friend

Definition at line 413 of file qqmllistmodel_p_p.h.

◆ QQmlListModelWorkerAgent

friend class QQmlListModelWorkerAgent
friend

Definition at line 412 of file qqmllistmodel_p_p.h.


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