QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
FactGroupListModel Class Referenceabstract

Dynamically manages FactGroupWithIds based on incoming messages. More...

#include <FactGroupListModel.h>

Inheritance diagram for FactGroupListModel:
Collaboration diagram for FactGroupListModel:

Public Member Functions

 FactGroupListModel (const char *factGroupNamePrefix, QObject *parent=nullptr)
void handleMessageForFactGroupCreation (Vehicle *vehicle, const mavlink_message_t &message)
 Allows for creation/updating of dynamic FactGroups based on incoming messages.
Public Member Functions inherited from QmlObjectListModel
 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

virtual bool _shouldHandleMessage (const mavlink_message_t &message, QList< uint32_t > &ids) const =0
virtual FactGroupWithId * _createFactGroupWithId (uint32_t id)=0
FactGroupWithId * _findOrAddFactGroupById (Vehicle *vehicle, uint32_t id)
QString _factGroupNameWithId (uint32_t id) const
Protected Member Functions inherited from QmlObjectListModel
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 ()

Protected Attributes

const char * _factGroupNamePrefix
Protected Attributes inherited from ObjectListModelBase
bool _skipDirtyFirstItem = false
Protected Attributes inherited from ObjectItemModelBase
bool _dirty = false
uint _resetModelNestingCount = 0

Additional Inherited Members

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

Detailed Description

Dynamically manages FactGroupWithIds based on incoming messages.

Definition at line 11 of file FactGroupListModel.h.

Constructor & Destructor Documentation

◆ FactGroupListModel()

FactGroupListModel::FactGroupListModel ( const char * factGroupNamePrefix,
QObject * parent = nullptr )
explicit

Member Function Documentation

◆ _createFactGroupWithId()

virtual FactGroupWithId * FactGroupListModel::_createFactGroupWithId ( uint32_t id)
protectedpure virtual

◆ _factGroupNameWithId()

QString FactGroupListModel::_factGroupNameWithId ( uint32_t id) const
protected

Definition at line 22 of file FactGroupListModel.cc.

References _factGroupNamePrefix.

Referenced by _findOrAddFactGroupById().

◆ _findOrAddFactGroupById()

FactGroupWithId * FactGroupListModel::_findOrAddFactGroupById ( Vehicle * vehicle,
uint32_t id )
protected

◆ _shouldHandleMessage()

virtual bool FactGroupListModel::_shouldHandleMessage ( const mavlink_message_t & message,
QList< uint32_t > & ids ) const
protectedpure virtual

◆ handleMessageForFactGroupCreation()

void FactGroupListModel::handleMessageForFactGroupCreation ( Vehicle * vehicle,
const mavlink_message_t & message )

Allows for creation/updating of dynamic FactGroups based on incoming messages.

Definition at line 11 of file FactGroupListModel.cc.

References _findOrAddFactGroupById(), and _shouldHandleMessage().

Member Data Documentation

◆ _factGroupNamePrefix

const char* FactGroupListModel::_factGroupNamePrefix
protected

Definition at line 30 of file FactGroupListModel.h.

Referenced by _factGroupNameWithId(), and FactGroupListModel().


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