summaryrefslogtreecommitdiffstats
path: root/ui/qt/models/path_selection_delegate.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/models/path_selection_delegate.h')
-rw-r--r--ui/qt/models/path_selection_delegate.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/ui/qt/models/path_selection_delegate.h b/ui/qt/models/path_selection_delegate.h
new file mode 100644
index 00000000..6d33f116
--- /dev/null
+++ b/ui/qt/models/path_selection_delegate.h
@@ -0,0 +1,35 @@
+/** @file
+ *
+ * Delegate to select a file path for a treeview entry
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef PATH_SELECTION_DELEGATE_H_
+#define PATH_SELECTION_DELEGATE_H_
+
+#include <QStyledItemDelegate>
+
+class PathSelectionDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+
+public:
+ PathSelectionDelegate(QObject *parent = 0);
+
+protected:
+ QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
+ void updateEditorGeometry (QWidget * editor, const QStyleOptionViewItem & option, const QModelIndex & idx) const override;
+ void setEditorData(QWidget *editor, const QModelIndex &idx) const override;
+ void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &idx) const override;
+
+protected slots:
+ void pathHasChanged(QString newPath);
+
+};
+
+#endif /* PATH_SELECTION_DELEGATE_H_ */