Commit a332a818 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Fix memory leak in class ObjectsWindow

CCBUG:301932
parent eb42f725
......@@ -32,11 +32,11 @@ ObjectsWindow::ObjectsWindow(const QString &title, QWidget *parent)
{
setObjectName(QLatin1String("ObjectsWindow"));
QSortFilterProxyModel *proxy = new QSortFilterProxyModel;
proxy->setSourceModel(UMLApp::app()->document()->objectsModel());
proxy->setSortCaseSensitivity(Qt::CaseInsensitive);
m_proxyModel = new QSortFilterProxyModel;
m_proxyModel->setSourceModel(UMLApp::app()->document()->objectsModel());
m_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
m_objectsTree = new QTableView;
m_objectsTree->setModel(proxy);
m_objectsTree->setModel(m_proxyModel);
m_objectsTree->setSortingEnabled(true);
m_objectsTree->verticalHeader()->setDefaultSectionSize(20);
m_objectsTree->verticalHeader()->setVisible(false);
......@@ -54,6 +54,7 @@ ObjectsWindow::ObjectsWindow(const QString &title, QWidget *parent)
ObjectsWindow::~ObjectsWindow()
{
delete m_objectsTree;
delete m_proxyModel;
}
void ObjectsWindow::modified()
......
......@@ -14,6 +14,7 @@
#include <QDockWidget>
#include <QModelIndex>
class QSortFilterProxyModel;
class QTableView;
class ObjectsWindow : public QDockWidget
......@@ -34,6 +35,7 @@ protected slots:
protected:
QTableView *m_objectsTree;
QSortFilterProxyModel *m_proxyModel;
};
#endif // ObjectsWindow_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment