diff options
author | David Faure <david.faure@kdab.com> | 2015-01-19 19:26:22 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2015-01-25 12:37:51 +0100 |
commit | dd23d9f161deda1e72c1f6c4eccf1c6d598bf752 (patch) | |
tree | e8a1b3f89c727e7cd9391d70b29c6d69d8e688dd /src/widgets/itemviews/qtreewidget.cpp | |
parent | 4910f416c2c0d1ec4a11408647bc6c96c719ce18 (diff) |
QTreeWidget: forbid forcing PartiallyChecked on parent tristate items.
ItemIsTristate means QTreeWidget determines the check state of parent
items based on the check state of child items.
Checking/unchecking the parent propagates to children; but setting
the parent to PartiallyChecked shouldn't do that, especially since it can
lead to children without ItemIsTristate having PartiallyChecked check state.
Change-Id: Ibc8b7c77d9ec4c1578c07f3c62581edb770f8439
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Diffstat (limited to 'src/widgets/itemviews/qtreewidget.cpp')
-rw-r--r-- | src/widgets/itemviews/qtreewidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index 704f8975b9..007760ef16 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -1720,7 +1720,7 @@ void QTreeWidgetItem::setData(int column, int role, const QVariant &value) } } break; case Qt::CheckStateRole: - if (itemFlags & Qt::ItemIsTristate) { + if ((itemFlags & Qt::ItemIsTristate) && value != Qt::PartiallyChecked) { for (int i = 0; i < children.count(); ++i) { QTreeWidgetItem *child = children.at(i); if (child->data(column, role).isValid()) {// has a CheckState |