diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index fd3f35e35ad..6e178e5c4d9 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -40,7 +40,7 @@ namespace Utils { class BaseTreeViewDelegate : public QItemDelegate { public: - BaseTreeViewDelegate() {} + BaseTreeViewDelegate(QObject *parent): QItemDelegate(parent) {} QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const @@ -64,7 +64,7 @@ BaseTreeView::BaseTreeView(QWidget *parent) setIconSize(QSize(10, 10)); setSelectionMode(QAbstractItemView::ExtendedSelection); setUniformRowHeights(true); - setItemDelegate(new BaseTreeViewDelegate); + setItemDelegate(new BaseTreeViewDelegate(this)); header()->setDefaultAlignment(Qt::AlignLeft); header()->setClickable(true); diff --git a/src/libs/utils/historycompleter.cpp b/src/libs/utils/historycompleter.cpp index 65a54d47e07..15fee7dd035 100644 --- a/src/libs/utils/historycompleter.cpp +++ b/src/libs/utils/historycompleter.cpp @@ -65,8 +65,9 @@ public: class HistoryLineDelegate : public QItemDelegate { public: - HistoryLineDelegate() - : pixmap(QLatin1String(":/core/images/editclear.png")) + HistoryLineDelegate(QObject *parent) + : QItemDelegate(parent) + , pixmap(QLatin1String(":/core/images/editclear.png")) {} void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const @@ -85,7 +86,7 @@ public: HistoryLineView(HistoryCompleterPrivate *model_) : model(model_) { - HistoryLineDelegate *delegate = new HistoryLineDelegate; + HistoryLineDelegate *delegate = new HistoryLineDelegate(this); pixmapWidth = delegate->pixmap.width(); setItemDelegate(delegate); }