1#ifndef PACKAGETABLEMODEL_H 
    2#define PACKAGETABLEMODEL_H 
    5#include <QAbstractTableModel> 
   37                             QObject *parent = 
nullptr);
 
   48  QVariant 
headerData(
int section, Qt::Orientation orientation,
 
   49                      int role = Qt::DisplayRole) 
const override;
 
   57  int rowCount(
const QModelIndex &parent = QModelIndex()) 
const override;
 
   65  int columnCount(
const QModelIndex &parent = QModelIndex()) 
const override;
 
   75  QVariant 
data(
const QModelIndex &index,
 
   76                int role = Qt::DisplayRole) 
const override;
 
   87  QList<Package> *m_packageList{
nullptr};
 
Represents a network package.
Definition package.h:28
 
Custom table model to represent a list of Package objects.
Definition packagetablemodel.h:25
 
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns under the given parent.
Definition packagetablemodel.cpp:42
 
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
Definition packagetablemodel.cpp:35
 
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns the data stored under the given role for the item referred to by the index.
Definition packagetablemodel.cpp:49
 
void addPackage(const Package &package)
Adds a new package to the table model.
Definition packagetablemodel.cpp:97
 
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns the data for the given role and section in the header with the specified orientation.
Definition packagetablemodel.cpp:10
 
Contains the Package class definition.