Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
AStringListListModel Class Referenceabstract

A table model backed by a list of string lists. More...

#include <astringlist_list_model.h>

Inheritance diagram for AStringListListModel:
AuthorListModel EthernetAddressModel FolderListModel PluginListModel PortsModel ShortcutListModel

Public Member Functions

 AStringListListModel (QObject *parent=Q_NULLPTR)
 Construct an empty model.
 
virtual ~AStringListListModel ()
 Destroy the model.
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 Return the number of rows in the model.
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 Return the number of columns in the model.
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 Return data for the given index and role.
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 Return header data for the given section, orientation, and role.
 
virtual void appendRow (const QStringList &row, const QString &row_tooltip=QString(), const QModelIndex &parent=QModelIndex())
 Append a row to the model.
 

Protected Member Functions

virtual QStringList headerColumns () const =0
 Return the list of column header strings.
 

Detailed Description

A table model backed by a list of string lists.

Each row is represented as a QStringList.

Constructor & Destructor Documentation

◆ AStringListListModel()

AStringListListModel::AStringListListModel ( QObject *  parent = Q_NULLPTR)
explicit

Construct an empty model.

Parameters
parentThe parent object.

Member Function Documentation

◆ appendRow()

void AStringListListModel::appendRow ( const QStringList &  row,
const QString &  row_tooltip = QString(),
const QModelIndex &  parent = QModelIndex() 
)
virtual

Append a row to the model.

This method is public rather than protected because it may need to be invoked from a wmem_map_foreach() callback implemented as an extern "C" static member function of a subclass. wmem_map_foreach() is passed, as the user data, a pointer to the class instance to which rows should be appended.

Parameters
rowThe string list representing the new row's data.
row_tooltipThe tooltip text for the new row.
parentUnused; present for API compatibility.

◆ columnCount()

int AStringListListModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Return the number of columns in the model.

Parameters
parentUnused; present for API compatibility.
Returns
The number of columns.

◆ data()

QVariant AStringListListModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
virtual

Return data for the given index and role.

Parameters
indexThe model index to query.
roleThe data role.
Returns
The data for the given index and role, or an invalid QVariant if the index or role is unsupported.

◆ headerColumns()

virtual QStringList AStringListListModel::headerColumns ( ) const
protectedpure virtual

Return the list of column header strings.

Returns
A QStringList of column header names.

Implemented in AuthorListModel, PluginListModel, FolderListModel, ShortcutListModel, EthernetAddressModel, and PortsModel.

◆ headerData()

QVariant AStringListListModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual

Return header data for the given section, orientation, and role.

Parameters
sectionThe section index.
orientationThe header orientation.
roleThe data role.
Returns
The header data, or an invalid QVariant if unsupported.

◆ rowCount()

int AStringListListModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Return the number of rows in the model.

Parameters
parentUnused; present for API compatibility.
Returns
The number of rows.

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