Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-40060

Re-appeared problem with QTreeWidgetItem and flag ItemIsTristate

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.5.0
    • 4.6.1, 5.2.1, 5.4.0 Beta
    • Widgets: Itemviews
    • None
    • 4910f416c2c0d1ec4a11408647bc6c96c719ce18

    Description

      The expectation of using the flag ItemIsTristate on an QTreeWidgetItem is that its check state should be dependant of its children check state only. The "partially check" state should not be a mode available through the user click.

      I guess the expected states for an item with the tristate flag are:
      -all its children ckecked => the item is checked
      -no children checked => the item is unchecked
      -some children are checked / some are not => the item is partially checked
      -by clicking on the item checkbox the item should be either checked (and with it all it children) or unchecked (and with it all its children).

      Now the problem is that if the user clicks the item's check box, the item can get the 3 states and its children as well. So the item check state can be set to "partially check" which causes all its children to get the "partially check" state as well; and this even if the children don't have the tristate flag set up or even if the children have no children which does not make sense.

      See file main.cpp to reproduce the issue

      Attachments

        1. main.cpp
          0.9 kB
        2. qtbug40160.zip
          1 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-40060
          # Subject Branch Project Status CR V

          Activity

            People

              dfaure David Faure (Private)
              wpctoma Toni Mattila
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes