10#ifndef VOIP_CALLS_INFO_MODEL_H
11#define VOIP_CALLS_INFO_MODEL_H
18#include <QAbstractTableModel>
19#include <QSortFilterProxyModel>
43 QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
52 QVariant
headerData(
int section, Qt::Orientation orientation,
53 int role = Qt::DisplayRole)
const override;
60 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
67 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
119 QList<void *> callinfos_;
153 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right)
const override;
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns in the model.
Definition voip_calls_info_model.cpp:152
void updateCalls(GQueue *callsinfos)
Replaces the model's call list with the contents of callsinfos and notifies the view to refresh.
Definition voip_calls_info_model.cpp:190
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of call records currently held by the model.
Definition voip_calls_info_model.cpp:142
VoipCallsInfoModel(QObject *parent=0)
Constructs the model with an empty call list.
Definition voip_calls_info_model.cpp:18
static voip_calls_info_t * indexToCallInfo(const QModelIndex &index)
Returns the voip_calls_info_t record associated with index.
Definition voip_calls_info_model.cpp:24
void setTimeOfDay(bool timeOfDay)
Controls whether timestamps are shown as time-of-day or relative times.
Definition voip_calls_info_model.cpp:176
void removeAllCalls()
Removes all call records from the model and notifies the view.
Definition voip_calls_info_model.cpp:223
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns column header labels for the VoIP calls table.
Definition voip_calls_info_model.cpp:111
bool timeOfDay() const
Returns whether timestamps are currently shown as time-of-day values.
Definition voip_calls_info_model.cpp:185
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns display or decoration data for the given cell.
Definition voip_calls_info_model.cpp:29
Column
Column indices for the VoIP calls table.
Definition voip_calls_info_model.h:104
@ To
Definition voip_calls_info_model.h:109
@ ColumnCount
Definition voip_calls_info_model.h:115
@ Comments
Definition voip_calls_info_model.h:114
@ StopTime
Definition voip_calls_info_model.h:106
@ Duration
Definition voip_calls_info_model.h:111
@ From
Definition voip_calls_info_model.h:108
@ StartTime
Definition voip_calls_info_model.h:105
@ InitialSpeaker
Definition voip_calls_info_model.h:107
@ Packets
Definition voip_calls_info_model.h:112
@ Protocol
Definition voip_calls_info_model.h:110
@ State
Definition voip_calls_info_model.h:113
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override
Compares two rows for sorting, using type-appropriate comparisons for numeric, duration,...
Definition voip_calls_info_model.cpp:236
VoipCallsInfoSortedModel(QObject *parent=0)
Constructs the sort proxy model.
Definition voip_calls_info_model.cpp:231
struct _voip_calls_info voip_calls_info_t
Unified record describing a single detected VoIP call across all supported protocols.