10#ifndef PROFILE_TREEVIEW_H
11#define PROFILE_TREEVIEW_H
16#include <QItemDelegate>
39 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const override;
46 virtual void setEditorData(QWidget *editor,
const QModelIndex &index)
const override;
95 virtual void showEvent(QShowEvent *)
override;
111 virtual void selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected)
override;
Item delegate that provides inline editing for profile name cells in the profile tree view.
Definition profile_tree_view.h:23
ProfileTreeEditDelegate(QWidget *parent=Q_NULLPTR)
Constructs a ProfileTreeEditDelegate.
Definition profile_tree_view.cpp:21
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Creates and returns an editor widget for the cell at index.
Definition profile_tree_view.cpp:23
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populates the editor widget with the current value from the model.
Definition profile_tree_view.cpp:32
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
Responds to selection changes, updating UI state and emitting itemUpdated() when appropriate.
Definition profile_tree_view.cpp:56
~ProfileTreeView()
Destroys the view and releases the associated delegate.
Definition profile_tree_view.cpp:51
virtual void showEvent(QShowEvent *) override
Restores the previously selected row when the view becomes visible.
Definition profile_tree_view.cpp:107
void itemUpdated()
Emitted when a profile item has been modified through the inline editor.
void selectRow(int row)
Selects the row at row in the view, scrolling it into view if necessary.
Definition profile_tree_view.cpp:80
bool activeEdit()
Returns whether an inline edit is currently active in the view.
Definition profile_tree_view.cpp:100
ProfileTreeView(QWidget *parent=nullptr)
Constructs a ProfileTreeView.
Definition profile_tree_view.cpp:41
virtual void mouseDoubleClickEvent(QMouseEvent *event) override
Opens an inline editor for the double-clicked cell when the profile is editable; otherwise propagates...
Definition profile_tree_view.cpp:93