Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
numeric_value_chooser_delegate.h
Go to the documentation of this file.
1
12#ifndef NUMERIC_VALUE_CHOOSER_DELEGATE_H_
13#define NUMERIC_VALUE_CHOOSER_DELEGATE_H_
14
15
16#include <QStyledItemDelegate>
17
18class NumericValueChooserDelegate : public QStyledItemDelegate
19{
20 Q_OBJECT
21
22public:
23 NumericValueChooserDelegate(int min = 0, int max = 0, QObject *parent = 0);
25
26 void setMinMaxRange(int min, int max);
27 void setDefaultValue(int defValue, QVariant defaultReturn);
28
29protected:
30 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
31 void setEditorData(QWidget *editor, const QModelIndex &index) const;
32 void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
33
34private:
35
36 int _min;
37 int _max;
38 int _default;
39 QVariant _defReturn;
40
41private slots:
42 void onValueChanged(int i);
43};
44
45#endif /* NUMERIC_VALUE_CHOOSER_DELEGATE_H_ */
Definition numeric_value_chooser_delegate.h:19