DolphinQt: Fix memory lkea in FilesystemWidget

QTreeView::setModel doesn't transfer ownership of the object.

Setting the parent resolves this
This commit is contained in:
Michael Cook (mackal) 2023-04-04 15:59:45 -04:00
parent b63b574a3f
commit 2dca24229b
1 changed files with 1 additions and 0 deletions

View File

@ -62,6 +62,7 @@ void FilesystemWidget::CreateWidgets()
m_tree_view = new QTreeView(this); m_tree_view = new QTreeView(this);
m_tree_view->setModel(m_tree_model); m_tree_view->setModel(m_tree_model);
m_tree_view->setContextMenuPolicy(Qt::CustomContextMenu); m_tree_view->setContextMenuPolicy(Qt::CustomContextMenu);
m_tree_model->setParent(m_tree_view);
auto* header = m_tree_view->header(); auto* header = m_tree_view->header();