Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
coloring_rules_delegate.h
Go to the documentation of this file.
1
12#ifndef COLORING_RULE_DELEGATE_H
13#define COLORING_RULE_DELEGATE_H
14
15#include <config.h>
16
17#include <QStyledItemDelegate>
18#include <QModelIndex>
19
23class ColoringRulesDelegate : public QStyledItemDelegate
24{
25 Q_OBJECT
26
27public:
32 ColoringRulesDelegate(QObject *parent = 0);
33
41 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
42 const QModelIndex &index) const;
43
50 void paint(QPainter *painter, const QStyleOptionViewItem &option,
51 const QModelIndex &index) const;
52
58 void setEditorData(QWidget *editor, const QModelIndex &index) const;
59
66 void setModelData(QWidget *editor, QAbstractItemModel *model,
67 const QModelIndex &index) const;
68
75 void updateEditorGeometry(QWidget *editor,
76 const QStyleOptionViewItem &option, const QModelIndex &index) const;
77
78signals:
84 void invalidField(const QModelIndex &index, const QString& errMessage) const;
85
90 void validField(const QModelIndex &index) const;
91
92private slots:
97 void ruleNameChanged(const QString name);
98};
99#endif // COLORING_RULE_DELEGATE_H
A delegate for rendering and editing coloring rules in a view.
Definition coloring_rules_delegate.h:24
void validField(const QModelIndex &index) const
Signal emitted when a field contains valid data.
void setEditorData(QWidget *editor, const QModelIndex &index) const
Sets the data for the editor from the model.
Definition coloring_rules_delegate.cpp:88
void invalidField(const QModelIndex &index, const QString &errMessage) const
Signal emitted when a field contains invalid data.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Creates an editor widget for editing a coloring rule.
Definition coloring_rules_delegate.cpp:65
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Sets the data in the model from the editor.
Definition coloring_rules_delegate.cpp:110
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Paints the coloring rule item.
Definition coloring_rules_delegate.cpp:21
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
Updates the geometry of the editor.
Definition coloring_rules_delegate.cpp:151