Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.6.1
-
None
-
1bc449a16051f09028cfcb78ebdffa6ee0440572
Description
Changes were made to QItemDelegate::editorEvent ( QEvent * event, QAbstractItemModel * model, const QStyleOptionViewItem & option, const QModelIndex & index ) in which now upon clicking an item's checkbox if that item has the Qt::ItemIsTristate flag set it will cycle through Checked, PartiallyChecked, and Unchecked states.
My understanding of the behavior of an item set to Qt::ItemIsTristate is that its CheckState should be dependent on the CheckState of its children. This is best explained in this reply to a previous bug report for Qt which can be found at http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=108755 :
"The intended usage of Qt::ItemIsTristate is to signify that the checked state of an item should be computed as a function of the checked states of its child items; e.g. no child items checked => parent becomes unchecked; some child items checked => parent is partially checked; all child items checked => parent item checked. Therefore, the default item delegate does not have provisions for interactive partial checking of items. However, you can reimplement QItemDelegate::editorEvent() and change the behavior to what you want...."
Unless the intended usage of the Qt::ItemIsTristate flag has changed in Qt 4.6, I think it makes more sense to set the default behavior of QItemDelegate::editorEvent back to solely toggling between Qt::Checked and Qt::Unchecked, instead of also allowing for Qt::PartiallyChecked to be toggled interactively.
Attachments
Issue Links
- relates to
-
QTBUG-40060 Re-appeared problem with QTreeWidgetItem and flag ItemIsTristate
- Closed
- replaces
-
QTBUG-7806 QTreeWidgetItem and flag ItemIsTristate
- Closed