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

addressbook does not sort the Name column the first time the Name header is clicked

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.3.2
    • 5.3.0
    • Examples and Demos
    • None
    • Ubuntu 14.04 (amd64)

    Description

      First I start the addressbook example (widgets/itemviews/addressbook), and add an entry with the name "a" and then I add an entry with the name "b".
      I then see a table where the first row contains "a" and the second row contains "b".

      The first time I click the header "Name", the sorting of the rows is not changed but instead the triangle is turned up-side-down.
      I would expect the first click to also change the order of the rows.

      I think this patch fixes the problem

      — old/addresswidget.cpp 2014-06-11 14:25:08.167624525 +0200
      +++ new/addresswidget.cpp 2014-06-11 14:25:17.075624739 +0200
      @@ -180,7 +180,7 @@

      proxyModel->setFilterRegExp(QRegExp(newStr, Qt::CaseInsensitive));
      proxyModel->setFilterKeyColumn(0);

      • proxyModel->sort(0, Qt::AscendingOrder);
        + tableView->sortByColumn(0, Qt::AscendingOrder);

      connect(tableView->selectionModel(),
      SIGNAL(selectionChanged(QItemSelection,QItemSelection)),

      Attachments

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

        Activity

          People

            treinio Topi Reiniö
            eriksjolund Erik Sjölund
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes