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

QItemDelegate and ItemIsTristate flag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.1
    • 4.6.1
    • Widgets: Itemviews
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vfm Thierry Bastian (closed Nokia identity) (Inactive)
              badfish5248 victor malaret
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes