summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2021-03-29 18:34:43 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-12 16:40:01 +0000
commit6d70441d2d53d97386f63652a47b695b5d6f2167 (patch)
treeccb300e99af8735592d29c653bf10ebf48f46bf4 /src
parent42c468a1994df71cdf8ca7bce61f7698091355c2 (diff)
QAbstractItemModelTester: fix false positive when model has zero columns
Regression introduced by me in commit 72e0d699cec09458ca9325035d477d4899e8e47b Fixes: QTBUG-92220 Change-Id: Ic7dd4eda0a1993f9763933882baf928bfc83b08b Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b4aac2af19690917553f93660e3ad760fc15d0b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/testlib/qabstractitemmodeltester.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testlib/qabstractitemmodeltester.cpp b/src/testlib/qabstractitemmodeltester.cpp
index dd643c8945..d11c59b8e8 100644
--- a/src/testlib/qabstractitemmodeltester.cpp
+++ b/src/testlib/qabstractitemmodeltester.cpp
@@ -438,7 +438,7 @@ void QAbstractItemModelTesterPrivate::parent()
// when asked for the parent of an invalid index.
MODELTESTER_VERIFY(!model->parent(QModelIndex()).isValid());
- if (model->rowCount() == 0)
+ if (model->rowCount() == 0 || model->columnCount() == 0)
return;
// Column 0 | Column 1 |