diff options
author | Samuel Gaist <samuel.gaist@idiap.ch> | 2021-03-27 08:50:18 +0100 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@idiap.ch> | 2021-03-29 12:09:41 +0100 |
commit | e65558c230bc48ae9cced1f147180f4e33517791 (patch) | |
tree | 7b21fd59830614b472e6934e3f324b718cb7f130 /examples/widgets/itemviews/editabletreemodel/mainwindow.cpp | |
parent | 69dcdbc8daa2c40397dd021fc31c47ad528d9d83 (diff) |
Fix Editable Tree Model example model rowCount and model instance leak
The rowCount method has been fixed to correctly pass the "Common error
test #3: the second column should NOT have the same children".
It also fixes the model being leaked.
Fixes: QTBUG-92178
Pick-to: 5.15
Change-Id: If92973e6f83ea9a2715bd335269f6e50d80f52c6
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'examples/widgets/itemviews/editabletreemodel/mainwindow.cpp')
-rw-r--r-- | examples/widgets/itemviews/editabletreemodel/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp b/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp index 7faa325469..47fc232751 100644 --- a/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp +++ b/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp @@ -62,7 +62,7 @@ MainWindow::MainWindow(QWidget *parent) QFile file(":/default.txt"); file.open(QIODevice::ReadOnly); - TreeModel *model = new TreeModel(headers, file.readAll()); + TreeModel *model = new TreeModel(headers, file.readAll(), this); file.close(); view->setModel(model); |