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

QTableWidget doesn't shifts focus smoothly across items with identical initials item.

    XMLWordPrintable

Details

    • Windows

    Description

      1) Create a QTableWidget with m*n rows and columns in Qt Designer and give some layout to it.
      2) Now, edit few rows with identical characters(the start of the items should be same character ex: abc, agc, adf.) and rest with different.

      3) Now try to preview it with ctrl+r.

      4) Select the first row.
      5) Now press the identical keys present in the list, for ex "a" for the above given names.

      Desired behavior : The focus should switch smoothly to items starting with "a".
      Issue: the focus doesn't switch properly, it does switch few times and then it doesn't. 

      Code to reproduce the issue:

      int main(int argc, char* argv[])
      {
          QApplication app(argc, argv);
          QTableWidget tw;
          tw.setColumnCount(3);
          tw.setRowCount(5);
          auto item = new QTableWidgetItem("ab");
          item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
          tw.setItem(0, 0, item);
          item = new QTableWidgetItem("ahg");
          item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
          tw.setItem(1, 0, item);
          item = new QTableWidgetItem("jk");
          item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
          tw.setItem(2, 0, item);
          item = new QTableWidgetItem("gh");
          item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
          tw.setItem(3, 0, item);
          item = new QTableWidgetItem("adh");
          item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
          tw.setItem(4, 0, item);
          tw.show();
          return app.exec();
      }
      

       

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            ankur1107 Ankur Sharma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes