12#ifndef PACKET_LIST_PROXY_MODEL_H
13#define PACKET_LIST_PROXY_MODEL_H
17#include <QAbstractProxyModel>
170 void setSourceModel(QAbstractItemModel *source_model)
override;
171 QModelIndex mapToSource(
const QModelIndex &proxy_index)
const override;
172 QModelIndex mapFromSource(
const QModelIndex &source_index)
const override;
173 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex())
const override;
174 QModelIndex parent(
const QModelIndex &child)
const override;
175 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
176 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
177 bool hasChildren(
const QModelIndex &parent = QModelIndex())
const override;
186 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
208 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder)
override;
228 void sourceRowsInserted(
const QModelIndex &parent,
int first,
int last);
229 void sourceModelAboutToBeReset();
230 void sourceModelReset();
231 void sourceDataChanged(
const QModelIndex &source_top_left,
const QModelIndex &source_bottom_right,
232 const QList<int> &roles);
233 void sourceHeaderDataChanged(Qt::Orientation orientation,
int first,
int last);
240 QVector<PacketListRecord *> visible_rows_;
243 QVector<int> number_to_row_;
246 QHash<QString, int> aggregation_key_row_;
249 bool need_recreate_visible_rows_;
252 QElapsedTimer *idle_dissection_timer_;
255 int idle_dissection_row_;
261 void clearVisibleRows();
264 static int sort_column_;
267 static int sort_column_is_numeric_;
270 static int text_sort_column_;
273 static Qt::SortOrder sort_order_;
307 static double parseNumericColumn(
const QString &val,
bool *ok);
310 static bool stop_flag_;
316 static double exp_comps_;
319 static double comps_;
326 bool isNumericColumn(
int column);
struct _capture_file capture_file
Represents a capture file and its associated metadata.
A Qt item model representing the list of packets in a capture file.
Definition packet_list_model.h:36
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
Sorts the model based on the specified column.
Definition packet_list_proxy_model.cpp:356
unsigned recreateVisibleRows()
Recreates the list of visible rows based on filters and state.
Definition packet_list_proxy_model.cpp:210
frame_data * getRowFdata(QModelIndex idx) const
Retrieves the frame data for a given model index.
Definition packet_list_proxy_model.cpp:784
PacketListProxyModel(QObject *parent=nullptr)
Constructs a new PacketListProxyModel.
Definition packet_list_proxy_model.cpp:58
void stopSorting()
Stops an ongoing sorting operation.
Definition packet_list_proxy_model.cpp:506
~PacketListProxyModel()
Destroys the PacketListProxyModel.
Definition packet_list_proxy_model.cpp:74
void dissectIdle(bool reset=false)
Performs dissection work during application idle time.
Definition packet_list_proxy_model.cpp:747
int visibleIndexOf(const frame_data *fdata) const
Returns the visible index of the given frame data.
Definition packet_list_proxy_model.cpp:812
void flushVisibleRows()
Inserts any packets appended to the source model since the last update, and the visible ones among th...
Definition packet_list_proxy_model.cpp:736
bool pinnedRecordLessThan(int frame_num_a, int frame_num_b) const
Orders two frame/packet numbers the same way the primary view's current sort would,...
Definition packet_list_proxy_model.cpp:716
PacketListModel * packetListModel() const
The source model, if it is a PacketListModel.
Definition packet_list_proxy_model.h:60
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns the source model's header data.
Definition packet_list_proxy_model.cpp:190
void goToPacket(int packet_num)
Signal emitted to navigate the view to a specific packet number.
void ensureRowColorized(int row)
Ensures that a specific row has been colorized.
Definition packet_list_proxy_model.cpp:800
void setDisplayedFrameIgnore(bool set)
Sets the ignore state for all currently displayed frames.
Definition packet_list_proxy_model.cpp:337
int packetNumberToRow(int packet_num) const
Converts a packet number to a row index.
Definition packet_list_proxy_model.cpp:198
HiddenReason
Definition packet_list_proxy_model.h:144
@ Shown
The packet has a row of its own.
Definition packet_list_proxy_model.h:145
@ FilteredOut
The display filter excludes the packet.
Definition packet_list_proxy_model.h:146
@ Aggregated
The aggregation view folded it into another packet's row.
Definition packet_list_proxy_model.h:147
void needRecreateVisibleRows()
Flags the model as needing to recreate its visible rows.
Definition packet_list_proxy_model.cpp:205
int rowOfPacket(const frame_data *fdata) const
Returns the row showing the given packet itself.
Definition packet_list_proxy_model.cpp:820
void bgColorizationProgress(int first, int last)
Signal emitted to report background colorization progress.
void setDisplayedFrameMark(bool set)
Sets the mark state for all currently displayed frames.
Definition packet_list_proxy_model.cpp:330
HiddenReason hiddenReason(const frame_data *fdata) const
Returns why the given packet has no row of its own, if it doesn't.
Definition packet_list_proxy_model.cpp:826
Represents a single record within the packet list.
Definition packet_list_record.h:40
A frame for displaying progress indications and dialogs.
Definition progress_frame.h:40
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.