Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
path_selection_delegate.h
Go to the documentation of this file.
1
12#ifndef PATH_SELECTION_DELEGATE_H_
13#define PATH_SELECTION_DELEGATE_H_
14
15#include <QStyledItemDelegate>
16
20class PathSelectionDelegate : public QStyledItemDelegate
21{
22 Q_OBJECT
23
24public:
29 PathSelectionDelegate(QObject *parent = 0);
30
31protected:
39 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
40
47 void updateEditorGeometry (QWidget * editor, const QStyleOptionViewItem & option, const QModelIndex & idx) const override;
48
54 void setEditorData(QWidget *editor, const QModelIndex &idx) const override;
55
62 void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &idx) const override;
63
64protected slots:
69 void pathHasChanged(QString newPath);
70};
71
72#endif /* PATH_SELECTION_DELEGATE_H_ */
A delegate for selecting and editing file or directory paths in a view.
Definition path_selection_delegate.h:21
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &idx) const override
Saves the data from the editor back into the model.
Definition path_selection_delegate.cpp:51
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &idx) const override
Creates the custom editor widget for path selection.
Definition path_selection_delegate.cpp:19
void setEditorData(QWidget *editor, const QModelIndex &idx) const override
Sets the data to be displayed in the editor.
Definition path_selection_delegate.cpp:40
void pathHasChanged(QString newPath)
Slot triggered when the selected path changes in the editor.
Definition path_selection_delegate.cpp:28
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &idx) const override
Updates the geometry of the editor to fit the item.
Definition path_selection_delegate.cpp:35