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

QListWidget: extended selections and shift clicking behavior

    XMLWordPrintable

Details

    Description

      It seems extended selections and shift clicking has strange behaviour.
      On windows the initial faint selection rectangle explains some of this behavior, but on mac the behavior is even less obvious.

      Consider a demo application with three items A B and C in a list widget.

      Start this app up and shift click "C". There was no prior
      selection so expected result is that only "C" is selected.

      Instead "A" and "B" get selected too. Next, click off to clear the selection, aka click below "C" in the list. Now try shift-clicking "C" again. Based on the bizarre behavior we saw before we'd expect all three entries to be
      selected again. Nope. NOTHING gets selected this time.

      In both situations the most correct result would be that only "C" should be
      selected.

      Here is the demo application :

      #include <QtGui>

      class Widget : public QWidget
      {
      public:
      Widget(QWidget *parent);
      };

      Widget::Widget(QWidget *parent) : QWidget(parent)
      {
      QListWidget* list1 = new QListWidget();
      list1->setSelectionMode(QAbstractItemView::ExtendedSelection);
      list1->addItem("A");
      list1->addItem("B");
      list1->addItem("C");

      QGridLayout* grid = new QGridLayout(this);
      grid->addWidget(list1, 0,0);
      }

      int main(int argc, char **argv)
      {
      QApplication app(argc, argv);
      Widget w(NULL); w.show();
      return app.exec();
      }

      Attachments

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

        Activity

          People

            monsen Marius Bugge Monsen
            dettman Dean Dettman (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes