QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QmlObjectListModel Class Reference

#include <QmlObjectListModel.h>

Inheritance diagram for QmlObjectListModel:
Collaboration diagram for QmlObjectListModel:

Public Member Functions

 QmlObjectListModel (QObject *parent=nullptr)
int count () const override final
bool isEmpty () const override final
void setDirty (bool dirty) override final
void clear () override final
QObject * removeOne (const QObject *object) override final
bool contains (const QObject *object) override final
void clearAndDeleteContents () override final
 Clears the list and calls deleteLater on each entry.
Q_INVOKABLE QObject * get (int index)
QObject * operator[] (int index)
const QObject * operator[] (int index) const
void append (QObject *object)
 Caller maintains responsibility for object ownership and deletion.
void append (QList< QObject * > objects)
 Caller maintains responsibility for object ownership and deletion.
QObjectList swapObjectList (const QObjectList &newlist)
QObject * removeAt (int index)
void insert (int index, QObject *object)
void insert (int index, QList< QObject * > objects)
int indexOf (const QObject *object)
void move (int from, int to)
template<class T>
T value (int index) const
QList< QObject * > * objectList ()
Public Member Functions inherited from ObjectListModelBase
 ObjectListModelBase (QObject *parent=nullptr)
 ~ObjectListModelBase () override
QModelIndex index (int row, int column=0, const QModelIndex &parent=QModelIndex()) const override
QModelIndex parent (const QModelIndex &child) const override
int columnCount (const QModelIndex &parent=QModelIndex()) const override
bool hasChildren (const QModelIndex &parent=QModelIndex()) const override
Public Member Functions inherited from ObjectItemModelBase
 ObjectItemModelBase (QObject *parent=nullptr)
 ~ObjectItemModelBase () override
bool dirty () const
void beginResetModel ()
 Depth-counted beginResetModel — only the outermost call has effect.
void endResetModel ()
 Depth-counted endResetModel — only the outermost call has effect.

Protected Member Functions

int rowCount (const QModelIndex &parent=QModelIndex()) const override
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
bool insertRows (int position, int rows, const QModelIndex &index=QModelIndex()) override
bool removeRows (int position, int rows, const QModelIndex &index=QModelIndex()) override
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Protected Member Functions inherited from ObjectItemModelBase
QHash< int, QByteArray > roleNames () const override
void _signalCountChangedIfNotNested ()

Additional Inherited Members

Signals inherited from ObjectItemModelBase
void countChanged (int count)
void dirtyChanged (bool dirty)
Protected Slots inherited from ObjectItemModelBase
void _childDirtyChanged (bool dirty)
Protected Attributes inherited from ObjectListModelBase
bool _skipDirtyFirstItem = false
Protected Attributes inherited from ObjectItemModelBase
bool _dirty = false
uint _resetModelNestingCount = 0
Static Protected Attributes inherited from ObjectItemModelBase
static constexpr int ObjectRole = Qt::UserRole
static constexpr int TextRole = Qt::UserRole + 1

Detailed Description

Definition at line 5 of file QmlObjectListModel.h.

Constructor & Destructor Documentation

◆ QmlObjectListModel()

QmlObjectListModel::QmlObjectListModel ( QObject * parent = nullptr)

Member Function Documentation

◆ append() [1/2]

void QmlObjectListModel::append ( QList< QObject * > objects)

Caller maintains responsibility for object ownership and deletion.

Definition at line 248 of file QmlObjectListModel.cc.

References insert().

◆ append() [2/2]

void QmlObjectListModel::append ( QObject * object)

Caller maintains responsibility for object ownership and deletion.

Definition at line 243 of file QmlObjectListModel.cc.

References insert().

Referenced by FactValueGrid::appendColumn(), and FactValueGrid::appendRow().

◆ clear()

void QmlObjectListModel::clear ( )
finaloverridevirtual

◆ clearAndDeleteContents()

void QmlObjectListModel::clearAndDeleteContents ( )
finaloverridevirtual

Clears the list and calls deleteLater on each entry.

Implements ObjectListModelBase.

Definition at line 298 of file QmlObjectListModel.cc.

References clear().

◆ contains()

bool QmlObjectListModel::contains ( const QObject * object)
inlinefinaloverridevirtual

Implements ObjectListModelBase.

Definition at line 20 of file QmlObjectListModel.h.

◆ count()

◆ data()

QVariant QmlObjectListModel::data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
overrideprotectedvirtual

◆ get()

◆ indexOf()

int QmlObjectListModel::indexOf ( const QObject * object)
inline

Definition at line 33 of file QmlObjectListModel.h.

References indexOf().

Referenced by indexOf(), removeOne(), and VideoManager::selectSource().

◆ insert() [1/2]

void QmlObjectListModel::insert ( int index,
QList< QObject * > objects )

◆ insert() [2/2]

void QmlObjectListModel::insert ( int index,
QObject * object )

◆ insertRows()

bool QmlObjectListModel::insertRows ( int position,
int rows,
const QModelIndex & index = QModelIndex() )
overrideprotectedvirtual

◆ isEmpty()

bool QmlObjectListModel::isEmpty ( ) const
inlinefinaloverridevirtual

Reimplemented from ObjectItemModelBase.

Definition at line 16 of file QmlObjectListModel.h.

References count().

◆ move()

void QmlObjectListModel::move ( int from,
int to )

Definition at line 152 of file QmlObjectListModel.cc.

References count().

◆ objectList()

QList< QObject * > * QmlObjectListModel::objectList ( )
inline

Definition at line 36 of file QmlObjectListModel.h.

◆ operator[]() [1/2]

QObject * QmlObjectListModel::operator[] ( int index)

Definition at line 168 of file QmlObjectListModel.cc.

References ObjectListModelBase::index().

◆ operator[]() [2/2]

const QObject * QmlObjectListModel::operator[] ( int index) const

Definition at line 176 of file QmlObjectListModel.cc.

References ObjectListModelBase::index().

◆ removeAt()

◆ removeOne()

QObject * QmlObjectListModel::removeOne ( const QObject * object)
inlinefinaloverridevirtual

Implements ObjectListModelBase.

Definition at line 19 of file QmlObjectListModel.h.

References indexOf(), removeAt(), and removeOne().

Referenced by removeOne().

◆ removeRows()

bool QmlObjectListModel::removeRows ( int position,
int rows,
const QModelIndex & index = QModelIndex() )
overrideprotectedvirtual

◆ rowCount()

int QmlObjectListModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
overrideprotectedvirtual

Implements ObjectListModelBase.

Definition at line 72 of file QmlObjectListModel.cc.

References ObjectListModelBase::parent().

Referenced by count().

◆ setData()

bool QmlObjectListModel::setData ( const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole )
overrideprotectedvirtual

◆ setDirty()

void QmlObjectListModel::setDirty ( bool dirty)
finaloverridevirtual

◆ swapObjectList()

QObjectList QmlObjectListModel::swapObjectList ( const QObjectList & newlist)

◆ value()


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