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

QTableView: Navigation with NoItemFlags broken

    XMLWordPrintable

    Details

    • Platform/s:
      All
    • Commits:
      7863be311570fa219066df5fe8720d5b92ddb680 (qt/qtbase/5.12) 37c24c6b1b65c2ff9808e5c2e2a18cf496e4a9db (qt/qtbase/5.12)

      Description

      When using NoItemFlags on some cells of a QTableWidget you can't navigate the corresponding lines with Home/End or Ctrl+Home/End. (respective PageUp/PageDown)

      The navigation with those keys will not work (stays at the current cell), because the target cell is ignored. It would be preferable if the navigation would jump to the last cell that can be navigated to instead.
       
      If you use the frozencolumn example in Qt Creator you can just add the following to main.cpp in order to make the last item non selectable:

      QStandardItem *newItem = new QStandardItem();
      newItem->setFlags(Qt::NoItemFlags);
      model->setItem(model->rowCount() - 1, model->columnCount() - 1, newItem);
      

      Keep in mind that you need to have the item in the view to test this properly. I suggest reducing the number of rows and columns to something like 3.

      I included my adjusted frozencolumn project for testing purposes

      For further information see:
      https://forum.qt.io/topic/97252/table-navigation-with-noitemflags

        Attachments

        1. frozencolumn.7z
          6 kB
        2. qtbug72400.zip
          10 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            chehrlic Christian Ehrlicher
            Reporter:
            megamouse Patrick Waldner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes