logic: fixed some memory leaks in gui code

This commit is contained in:
mlangkabel
2018-01-19 16:15:20 +01:00
parent f4dfc4e298
commit 4ee0523b51
8 changed files with 43 additions and 30 deletions
+9 -1
View File
@@ -28,9 +28,17 @@ QIcon QtErrorView::s_errorIcon;
class SelectableDelegate
: public QStyledItemDelegate
{
public:
SelectableDelegate(QObject* parent = Q_NULLPTR);
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
};
SelectableDelegate::SelectableDelegate(QObject* parent)
: QStyledItemDelegate(parent)
{
}
QWidget* SelectableDelegate::createEditor(
QWidget* parent,
const QStyleOptionViewItem &option,
@@ -73,7 +81,7 @@ void QtErrorView::initView()
m_table = new QtTable(this);
m_model = new QStandardItemModel(this);
m_table->setModel(m_model);
m_table->setItemDelegate(new SelectableDelegate());
m_table->setItemDelegate(new SelectableDelegate(m_table));
// Setup Table Headers
m_model->setColumnCount(COLUMN_MAX + 1);