10#ifndef PACKET_LIST_MODEL_H
11#define PACKET_LIST_MODEL_H
19#include <QAbstractItemModel>
75 QModelIndex
index(
int row,
int column,
76 const QModelIndex &
parent = QModelIndex())
const override;
82 QModelIndex
parent(
const QModelIndex &)
const override;
112 int rowCount(
const QModelIndex &
parent = QModelIndex())
const override;
118 int columnCount(
const QModelIndex & = QModelIndex())
const override;
125 Qt::ItemFlags flags(
const QModelIndex &
index)
const override;
133 QVariant data(
const QModelIndex &d_index,
int role)
const override;
142 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
233 void addFrameComment(
const QModelIndexList &indices,
const QByteArray &comment);
282 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder)
override;
303 void onThemeChanged();
320 void refreshThemeColors();
326 QList<QString> col_names_;
329 QVector<PacketListRecord *> physical_rows_;
332 QVector<PacketListRecord *> visible_rows_;
335 QVector<PacketListRecord *> new_visible_rows_;
338 QVector<int> number_to_row_;
341 QHash<QString, int> aggregation_key_row_;
344 bool need_recreate_visible_rows_;
347 static int sort_column_;
350 static int sort_column_is_numeric_;
353 static int text_sort_column_;
356 static Qt::SortOrder sort_order_;
375 static double parseNumericColumn(
const QString &val,
bool *ok);
378 static bool stop_flag_;
384 static double exp_comps_;
387 static double comps_;
390 QElapsedTimer *idle_dissection_timer_;
393 int idle_dissection_row_;
400 bool isNumericColumn(
int column);
A Qt item model representing the list of packets in a capture file.
Definition packet_list_model.h:36
void setFrameComment(const QModelIndex &index, const QByteArray &comment, unsigned c_number)
Sets a specific comment on a frame.
Definition packet_list_model.cpp:443
void deleteFrameComments(const QModelIndexList &indices)
Deletes comments from the specified frames.
Definition packet_list_model.cpp:474
frame_data * getRowFdata(QModelIndex idx) const
Retrieves the frame data for a given model index.
Definition packet_list_model.cpp:1098
void unsetAllFrameRefTime()
Unsets the reference time state for all frames.
Definition packet_list_model.cpp:378
QModelIndex parent(const QModelIndex &) const override
Returns the parent of the model item.
Definition packet_list_model.cpp:133
void clear()
Clears the model data.
Definition packet_list_model.cpp:165
void toggleFrameIgnore(const QModelIndexList &indeces)
Toggles the ignore state for the specified frames.
Definition packet_list_model.cpp:301
void deleteAllFrameComments()
Deletes all frame comments from all frames.
Definition packet_list_model.cpp:507
void dissectIdle(bool reset=false)
Performs dissection work during application idle time.
Definition packet_list_model.cpp:1033
void resetColorized()
Resets the colorized state for all rows.
Definition packet_list_model.cpp:238
void setCaptureFile(capture_file *cf)
Sets the capture file for the model.
Definition packet_list_model.cpp:113
void bgColorizationProgress(int first, int last)
Signal emitted to report background colorization progress.
void flushVisibleRows()
Flushes the newly visible rows into the main visible rows view.
Definition packet_list_model.cpp:1016
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.
Definition packet_list_model.cpp:991
int columnCount(const QModelIndex &=QModelIndex()) const override
Returns the number of columns.
Definition packet_list_model.cpp:888
void invalidateAllColumnStrings()
Invalidate any cached column strings.
Definition packet_list_model.cpp:180
~PacketListModel()
Destroys the PacketListModel.
Definition packet_list_model.cpp:108
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
Definition packet_list_model.cpp:880
unsigned recreateVisibleRows()
Recreates the list of visible rows based on filters and state.
Definition packet_list_model.cpp:145
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
Sorts the model based on the specified column.
Definition packet_list_model.cpp:551
void ensureRowColorized(int row)
Ensures that a specific row has been colorized.
Definition packet_list_model.cpp:1114
@ HEADER_CAN_DISPLAY_DETAILS
Definition packet_list_model.h:47
@ HEADER_CAN_DISPLAY_STRINGS
Definition packet_list_model.h:45
void setDisplayedFrameIgnore(bool set)
Sets the ignore state for all currently displayed frames.
Definition packet_list_model.cpp:330
void stopSorting()
Stops an ongoing sorting operation.
Definition packet_list_model.cpp:677
int packetNumberToRow(int packet_num) const
Converts a packet number to a row index.
Definition packet_list_model.cpp:138
void needRecreateVisibleRows()
Flags the model as needing to recreate its visible rows.
Definition packet_list_model.h:100
void goToPacket(int packet_num)
Signal emitted to navigate the view to a specific packet number.
int appendPacket(frame_data *fdata)
Appends a packet to the model.
Definition packet_list_model.cpp:1070
int visibleIndexOf(const frame_data *fdata) const
Returns the visible index of the given frame data.
Definition packet_list_model.cpp:1126
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the index of the item in the model.
Definition packet_list_model.cpp:119
void toggleFrameRefTime(const QModelIndex &rt_index)
Toggles the reference time state for a specified frame.
Definition packet_list_model.cpp:350
void packetAppended(capture_file *cap_file, frame_data *fdata, qsizetype row)
Signal emitted when a packet is successfully appended.
void setDisplayedFrameMark(bool set)
Sets the mark state for all currently displayed frames.
Definition packet_list_model.cpp:281
void toggleFrameMark(const QModelIndexList &indeces)
Toggles the mark state for the specified frames.
Definition packet_list_model.cpp:252
void addFrameComment(const QModelIndexList &indices, const QByteArray &comment)
Adds a comment to the specified frames.
Definition packet_list_model.cpp:400
void resetColumns()
Rebuild columns from settings.
Definition packet_list_model.cpp:221
Represents a single record within the packet list.
Definition packet_list_record.h:32
A frame for displaying progress indications and dialogs.
Definition progress_frame.h:45
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.
Represents a capture file and its associated metadata.
Definition cfile.h:84