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

QListWidget checkboxes not shown until checkState is set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.14.0
    • None
    • Win 10, mingw-32
    • Windows

    Description

      In QListWidget, when flag ItemIsUserCheckable is set, a checkbox should appear next to the item. This doesn't happen until the checkState property is set, either checked or unchecked.

       

       

      for(int i = 0; i < widget->count(); ++i) {
        QListWidgetItem *item = widget->item(i);
        item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
        item->setCheckState(Qt::Unchecked); //without this line, checkboxes are not shown
      }
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            landolfi Davide Plavan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes