|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
A Qt item model representing the list of packets in a capture file. More...
#include <packet_list_model.h>
Public Types | |
| enum | { HEADER_CAN_DISPLAY_STRINGS = Qt::UserRole , HEADER_CAN_DISPLAY_DETAILS } |
| Custom roles used for header data. More... | |
Public Slots | |
| void | sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override |
| Sorts the model based on the specified column. | |
| void | stopSorting () |
| Stops an ongoing sorting operation. | |
| void | flushVisibleRows () |
| Flushes the newly visible rows into the main visible rows view. | |
| void | dissectIdle (bool reset=false) |
| Performs dissection work during application idle time. | |
Signals | |
| void | packetAppended (capture_file *cap_file, frame_data *fdata, qsizetype row) |
| Signal emitted when a packet is successfully appended. | |
| void | goToPacket (int packet_num) |
| Signal emitted to navigate the view to a specific packet number. | |
| void | bgColorizationProgress (int first, int last) |
| Signal emitted to report background colorization progress. | |
Public Member Functions | |
| PacketListModel (QObject *parent=0, capture_file *cf=NULL) | |
| Constructs a new PacketListModel. | |
| ~PacketListModel () | |
| Destroys the PacketListModel. | |
| void | setCaptureFile (capture_file *cf) |
| Sets the capture file for the model. | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| Returns the index of the item in the model. | |
| QModelIndex | parent (const QModelIndex &) const override |
| Returns the parent of the model item. | |
| int | packetNumberToRow (int packet_num) const |
| Converts a packet number to a row index. | |
| unsigned | recreateVisibleRows () |
| Recreates the list of visible rows based on filters and state. | |
| void | needRecreateVisibleRows () |
| Flags the model as needing to recreate its visible rows. | |
| void | clear () |
| Clears the model data. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of rows under the given parent. | |
| int | columnCount (const QModelIndex &=QModelIndex()) const override |
| Returns the number of columns. | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Returns the item flags for the given index. | |
| QVariant | data (const QModelIndex &d_index, int role) const override |
| Returns the data stored under the given role for the specified index. | |
| 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. | |
| int | appendPacket (frame_data *fdata) |
| Appends a packet to the model. | |
| frame_data * | getRowFdata (QModelIndex idx) const |
| Retrieves the frame data for a given model index. | |
| frame_data * | getRowFdata (int row) const |
| Retrieves the frame data for a given row. | |
| void | ensureRowColorized (int row) |
| Ensures that a specific row has been colorized. | |
| int | visibleIndexOf (const frame_data *fdata) const |
| Returns the visible index of the given frame data. | |
| void | invalidateAllColumnStrings () |
| Invalidate any cached column strings. | |
| void | resetColumns () |
| Rebuild columns from settings. | |
| void | resetColorized () |
| Resets the colorized state for all rows. | |
| void | toggleFrameMark (const QModelIndexList &indeces) |
| Toggles the mark state for the specified frames. | |
| void | setDisplayedFrameMark (bool set) |
| Sets the mark state for all currently displayed frames. | |
| void | toggleFrameIgnore (const QModelIndexList &indeces) |
| Toggles the ignore state for the specified frames. | |
| void | setDisplayedFrameIgnore (bool set) |
| Sets the ignore state for all currently displayed frames. | |
| void | toggleFrameRefTime (const QModelIndex &rt_index) |
| Toggles the reference time state for a specified frame. | |
| void | unsetAllFrameRefTime () |
| Unsets the reference time state for all frames. | |
| void | addFrameComment (const QModelIndexList &indices, const QByteArray &comment) |
| Adds a comment to the specified frames. | |
| void | setFrameComment (const QModelIndex &index, const QByteArray &comment, unsigned c_number) |
| Sets a specific comment on a frame. | |
| void | deleteFrameComments (const QModelIndexList &indices) |
| Deletes comments from the specified frames. | |
| void | deleteAllFrameComments () |
| Deletes all frame comments from all frames. | |
A Qt item model representing the list of packets in a capture file.
| anonymous enum |
|
explicit |
Constructs a new PacketListModel.
| parent | The parent QObject, defaults to 0. |
| cf | The capture file associated with the model, defaults to NULL. |
| void PacketListModel::addFrameComment | ( | const QModelIndexList & | indices, |
| const QByteArray & | comment | ||
| ) |
Adds a comment to the specified frames.
| indices | List of model indices to comment on. |
| comment | The comment text as a byte array. |
| int PacketListModel::appendPacket | ( | frame_data * | fdata | ) |
Appends a packet to the model.
| fdata | Pointer to the frame data. |
|
signal |
Signal emitted to report background colorization progress.
| first | The first row processed. |
| last | The last row processed. |
|
override |
Returns the number of columns.
|
override |
Returns the data stored under the given role for the specified index.
| d_index | The model index. |
| role | The display role. |
| void PacketListModel::deleteFrameComments | ( | const QModelIndexList & | indices | ) |
Deletes comments from the specified frames.
| indices | List of model indices to remove comments from. |
|
slot |
Performs dissection work during application idle time.
| reset | True to reset the idle dissection state. |
| void PacketListModel::ensureRowColorized | ( | int | row | ) |
Ensures that a specific row has been colorized.
| row | The row index to colorize. |
|
override |
Returns the item flags for the given index.
| index | The model index. |
| frame_data * PacketListModel::getRowFdata | ( | int | row | ) | const |
Retrieves the frame data for a given row.
| row | The row index. |
| frame_data * PacketListModel::getRowFdata | ( | QModelIndex | idx | ) | const |
Retrieves the frame data for a given model index.
| idx | The model index. |
|
signal |
Signal emitted to navigate the view to a specific packet number.
| packet_num | The target packet number. |
|
override |
Returns the data for the given role and section in the header.
| section | The header section. |
| orientation | The header orientation. |
| role | The display role. |
|
override |
Returns the index of the item in the model.
| row | The row of the item. |
| column | The column of the item. |
| parent | The parent index, defaults to QModelIndex(). |
|
signal |
Signal emitted when a packet is successfully appended.
| cap_file | Pointer to the capture file. |
| fdata | Pointer to the frame data. |
| row | The row index where the packet was added. |
| int PacketListModel::packetNumberToRow | ( | int | packet_num | ) | const |
Converts a packet number to a row index.
| packet_num | The packet number. |
|
override |
Returns the parent of the model item.
| unsigned PacketListModel::recreateVisibleRows | ( | ) |
Recreates the list of visible rows based on filters and state.
|
override |
Returns the number of rows under the given parent.
| parent | The parent model index. |
| void PacketListModel::setCaptureFile | ( | capture_file * | cf | ) |
Sets the capture file for the model.
| cf | Pointer to the capture file. |
| void PacketListModel::setDisplayedFrameIgnore | ( | bool | set | ) |
Sets the ignore state for all currently displayed frames.
| set | True to ignore, false to un-ignore. |
| void PacketListModel::setDisplayedFrameMark | ( | bool | set | ) |
Sets the mark state for all currently displayed frames.
| set | True to mark, false to unmark. |
| void PacketListModel::setFrameComment | ( | const QModelIndex & | index, |
| const QByteArray & | comment, | ||
| unsigned | c_number | ||
| ) |
Sets a specific comment on a frame.
| index | The model index of the frame. |
| comment | The comment text. |
| c_number | The comment number index. |
|
overrideslot |
Sorts the model based on the specified column.
| column | The column index to sort by. |
| order | The sort order (ascending or descending). |
| void PacketListModel::toggleFrameIgnore | ( | const QModelIndexList & | indeces | ) |
Toggles the ignore state for the specified frames.
| indeces | List of model indices to toggle. |
| void PacketListModel::toggleFrameMark | ( | const QModelIndexList & | indeces | ) |
Toggles the mark state for the specified frames.
| indeces | List of model indices to toggle. |
| void PacketListModel::toggleFrameRefTime | ( | const QModelIndex & | rt_index | ) |
Toggles the reference time state for a specified frame.
| rt_index | The model index of the frame. |
| int PacketListModel::visibleIndexOf | ( | const frame_data * | fdata | ) | const |
Returns the visible index of the given frame data.
| fdata | Pointer to the frame data. |