10#ifndef MANUF_TABLE_MODEL_H
11#define MANUF_TABLE_MODEL_H
13#include <QSortFilterProxyModel>
14#include <QAbstractTableModel>
18#include <epan/manuf.h>
74 virtual int rowCount(
const QModelIndex &parent = QModelIndex())
const ;
81 virtual int columnCount(
const QModelIndex &parent = QModelIndex())
const;
89 virtual QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
98 virtual QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
127 QList<ManufTableItem *> rows_;
164 virtual bool filterAcceptsRow(
int source_row,
const QModelIndex& source_parent)
const;
189 QByteArray filter_bytes_;
192 QRegularExpression filter_name_;
200 bool filterAddressAcceptsRow(
int source_row,
const QModelIndex& source_parent)
const;
208 bool filterNameAcceptsRow(
int source_row,
const QModelIndex& source_parent)
const;
A proxy model for sorting and filtering manufacturer data.
Definition manuf_table_model.h:134
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
Determines if a row is accepted by the current filter.
Definition manuf_table_model.cpp:233
ManufProxyFilterType
Enumeration of available filter types.
Definition manuf_table_model.h:142
@ FilterByAddress
Definition manuf_table_model.h:146
@ FilterEmpty
Definition manuf_table_model.h:144
@ FilterByName
Definition manuf_table_model.h:148
void setFilterAddress(const QByteArray &bytes)
Sets the filter to match a specific MAC address.
Definition manuf_table_model.cpp:172
void clearFilter()
Clears the active filter.
Definition manuf_table_model.cpp:157
void setFilterName(QRegularExpression &name)
Sets the filter to match a specific manufacturer name.
Definition manuf_table_model.cpp:186
A class representing a single manufacturer entry in the table.
Definition manuf_table_model.h:24
QString short_name_
Definition manuf_table_model.h:44
QByteArray block_bytes_
Definition manuf_table_model.h:38
QString block_name_
Definition manuf_table_model.h:41
QString long_name_
Definition manuf_table_model.h:47
~ManufTableItem()
Destroys the ManufTableItem.
Definition manuf_table_model.cpp:42
A table model for managing and displaying MAC address manufacturer data.
Definition manuf_table_model.h:54
~ManufTableModel()
Destroys the ManufTableModel.
Definition manuf_table_model.cpp:57
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Retrieves the number of columns in the model.
Definition manuf_table_model.cpp:67
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Retrieves the data stored under the given role for the item referred to by the index.
Definition manuf_table_model.cpp:72
void clear()
Clears all records from the model.
Definition manuf_table_model.cpp:121
void addRecord(struct ws_manuf *ptr)
Adds a new manufacturer record to the model.
Definition manuf_table_model.cpp:113
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Retrieves the header data for the given section, orientation, and role.
Definition manuf_table_model.cpp:131
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Retrieves the number of rows in the model.
Definition manuf_table_model.cpp:62
@ COL_MAC_PREFIX
Definition manuf_table_model.h:116
@ COL_VENDOR_NAME
Definition manuf_table_model.h:120
@ NUM_COLS
Definition manuf_table_model.h:122
@ COL_SHORT_NAME
Definition manuf_table_model.h:118
Represents a single manufacturer entry mapping an OUI or MA block to a vendor name.
Definition manuf.h:21