Plug remaining memleaks in tests/auto/widgets/itemviews

... on Linux AMD64 builds.

Pass QObject parents to QObjects otherwise leaked.

Change-Id: Ia4f0ad2fdc4ef62a3d35a2cfca74965f79692da3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2017-01-14 15:07:46 +01:00
parent e4b19bfb94
commit e15cb86b3b
3 changed files with 3 additions and 3 deletions

View File

@ -1350,7 +1350,7 @@ void tst_QItemDelegate::QTBUG4435_keepSelectionOnCheck()
}
QTableView view;
view.setModel(&model);
view.setItemDelegate(new TestItemDelegate);
view.setItemDelegate(new TestItemDelegate(&view));
view.show();
view.selectAll();
QVERIFY(QTest::qWaitForWindowExposed(&view));

View File

@ -1488,7 +1488,7 @@ void tst_QListView::task203585_selectAll()
//we make sure that "select all" doesn't select the hidden items
QListView view;
view.setSelectionMode(QAbstractItemView::ExtendedSelection);
view.setModel(new QStringListModel( QStringList() << "foo"));
view.setModel(new QStringListModel(QStringList() << "foo", &view));
view.setRowHidden(0, true);
view.selectAll();
QVERIFY(view.selectionModel()->selectedIndexes().isEmpty());

View File

@ -1629,7 +1629,7 @@ void tst_QListWidget::QTBUG14363_completerWithAnyKeyPressedEditTriggers()
{
QListWidget listWidget;
listWidget.setEditTriggers(QAbstractItemView::AnyKeyPressed);
listWidget.setItemDelegate(new ItemDelegate);
listWidget.setItemDelegate(new ItemDelegate(&listWidget));
QListWidgetItem *item = new QListWidgetItem(QLatin1String("select an item (don't start editing)"), &listWidget);
item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable|Qt::ItemIsEditable);
new QListWidgetItem(QLatin1String("try to type the letter 'c'"), &listWidget);