Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.7.0
-
None
-
Windows XP
Description
If one or more, but not all, of the children of the root item of a QTreeWidget are checked, the root item is shown as partially checked, and checkState returns Qt::PartiallyChecked, which is good so far. And when one programmatically sets the root item to Qt::Unchecked, all its children will be unchecked, and checkState on the root item returns Qt::Unchecked, but the root item in the QTreeWidget is still shown as partially checked, which is wrong. I attached a small example to demonstrate this.
- Start example
- During the first 3 seconds check one of the child items
- Wait for time out
- All children will be unchecked, checkState of rootItem will return 0 (=Qt::Unchecked), but it will be shown as partially checked
I have also included a workaround in this example, which unchecks all children, then the parent item will be shown correctly unchecked (Just uncomment the corresponding lines (38-40) in the timeUp slot). With this workaround, it is not necessary anymore to change the state of the parent item (line 42 can be commented).