Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
info_proxy_model.h
Go to the documentation of this file.
1
12#ifndef INFO_PROXY_MODEL_H
13#define INFO_PROXY_MODEL_H
14
15#include <config.h>
16
17#include <QStringList>
18#include <QIdentityProxyModel>
19
23class InfoProxyModel : public QIdentityProxyModel
24{
25public:
30 explicit InfoProxyModel(QObject * parent = 0);
31
36
42 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
43
50 virtual QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const;
51
57 virtual Qt::ItemFlags flags(const QModelIndex &index) const;
58
66 virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
67
73 virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const;
74
80 virtual QModelIndex mapFromSource(const QModelIndex &fromIndex) const;
81
86 void appendInfo(QString info);
87
91 void clearInfos();
92
97 void setColumn(int column);
98
99private:
100
101 int column_;
103 QStringList infos_;
104};
105
106#endif // INFO_PROXY_MODEL_H
Proxy model that appends additional information rows to a source model.
Definition info_proxy_model.h:24
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Returns the data stored under the given role for the item referred to by the index.
Definition info_proxy_model.cpp:44
~InfoProxyModel()
Destroys the InfoProxyModel.
Definition info_proxy_model.cpp:23
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const
Maps a proxy index to the corresponding source model index.
Definition info_proxy_model.cpp:85
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
Definition info_proxy_model.cpp:69
virtual QModelIndex mapFromSource(const QModelIndex &fromIndex) const
Maps a source model index to the corresponding proxy model index.
Definition info_proxy_model.cpp:96
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of rows under the given parent.
Definition info_proxy_model.cpp:39
void setColumn(int column)
Sets the column used for displaying the information.
Definition info_proxy_model.cpp:101
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Returns the index of the item in the model specified by the given row, column and parent index.
Definition info_proxy_model.cpp:77
void appendInfo(QString info)
Appends an information string to the model.
Definition info_proxy_model.cpp:28
void clearInfos()
Clears all appended information strings.
Definition info_proxy_model.cpp:34
Definition file-pcapng.h:57