Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
url_link_delegate.h
Go to the documentation of this file.
1
12#ifndef URL_LINK_DELEGATE_H
13#define URL_LINK_DELEGATE_H
14
15#include <QStyledItemDelegate>
16#include <QStyleOptionViewItem>
17#include <QModelIndex>
18#include <QRegularExpression>
19
23class UrlLinkDelegate : public QStyledItemDelegate
24{
25public:
30 explicit UrlLinkDelegate(QObject *parent = Q_NULLPTR);
31
36
37 // If pattern matches the string in column, render as a URL.
38 // Otherwise render as plain text.
44 void setColCheck(int column, QString &pattern);
45
46protected:
53 virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
54
55private:
57 int re_col_;
58
60 QRegularExpression *url_re_;
61};
62#endif // URL_LINK_DELEGATE_H