12#ifndef PATH_SELECTION_DELEGATE_H_
13#define PATH_SELECTION_DELEGATE_H_
15#include <QStyledItemDelegate>
39 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &idx)
const override;
47 void updateEditorGeometry (QWidget * editor,
const QStyleOptionViewItem & option,
const QModelIndex & idx)
const override;
54 void setEditorData(QWidget *editor,
const QModelIndex &idx)
const override;
62 void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &idx)
const override;
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