| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
profile_tree_view.h
Go to the documentation of this file.
1
9
10#ifndef PROFILE_TREEVIEW_H
11#define PROFILE_TREEVIEW_H
12
13#include <ui/qt/models/url_link_delegate.h>
14
15#include <QTreeView>
16#include <QItemDelegate>
17
22 class ProfileTreeEditDelegate : public QItemDelegate
23{
24 Q_OBJECT
25 public:
30 ProfileTreeEditDelegate(QWidget *parent = Q_NULLPTR);
31
39 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
40
46 virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override;
47
48 private:
49 QWidget *editor_;
50 QModelIndex index_;
51};
52
53
58 class ProfileTreeView : public QTreeView
59{
60 Q_OBJECT
61 public:
66 ProfileTreeView(QWidget *parent = nullptr);
67
71 ~ProfileTreeView();
72
77 void selectRow(int row);
78
83 bool activeEdit();
84
85signals:
89 void itemUpdated();
90
91 protected:
95 virtual void showEvent(QShowEvent *) override;
96
102 virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
103
104 protected slots:
111 virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;
112
113 private:
114 ProfileTreeEditDelegate *delegate_;
115};
116
117#endif
ProfileTreeEditDelegate
Item delegate that provides inline editing for profile name cells in the profile tree view.
Definition profile_tree_view.h:23
ProfileTreeEditDelegate::ProfileTreeEditDelegate
ProfileTreeEditDelegate(QWidget *parent=Q_NULLPTR)
Constructs a ProfileTreeEditDelegate.
Definition profile_tree_view.cpp:21
ProfileTreeEditDelegate::createEditor
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
ProfileTreeEditDelegate::setEditorData
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
ProfileTreeView::selectionChanged
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::~ProfileTreeView
~ProfileTreeView()
Destroys the view and releases the associated delegate.
Definition profile_tree_view.cpp:51
ProfileTreeView::showEvent
virtual void showEvent(QShowEvent *) override
Restores the previously selected row when the view becomes visible.
Definition profile_tree_view.cpp:107
ProfileTreeView::itemUpdated
void itemUpdated()
Emitted when a profile item has been modified through the inline editor.
ProfileTreeView::selectRow
void selectRow(int row)
Selects the row at row in the view, scrolling it into view if necessary.
Definition profile_tree_view.cpp:80
ProfileTreeView::activeEdit
bool activeEdit()
Returns whether an inline edit is currently active in the view.
Definition profile_tree_view.cpp:100
ProfileTreeView::ProfileTreeView
ProfileTreeView(QWidget *parent=nullptr)
Constructs a ProfileTreeView.
Definition profile_tree_view.cpp:41
ProfileTreeView::mouseDoubleClickEvent
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
url_link_delegate.h