diff options
author | Samuel Gaist <samuel.gaist@idiap.ch> | 2021-03-27 08:50:18 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-07 12:21:23 +0000 |
commit | b269ea10c76fd9d7053d0374d9fd16fff2d79a73 (patch) | |
tree | 00fcc71d5f63873be60ebff920a080147611f062 /examples/widgets/itemviews/editabletreemodel/mainwindow.cpp | |
parent | 55815d8895d06b4de52cc6fbedab94c3ed99c881 (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
Change-Id: If92973e6f83ea9a2715bd335269f6e50d80f52c6
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit e65558c230bc48ae9cced1f147180f4e33517791)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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); |