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

QTableWidget can't select row 0 after removeRow(0);

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.11.2
    • Widgets: Itemviews
    • None

    Description

      Add a QTableWidget, single selected, row selected, add some rows, such as 10 rows.

      Select 1st row which is index as 0, then removeRow(0), on the UI, the former 1st row disappears, the former 2nd row becomes the current 1st row which is selected. But if use QTableWidget::selectedRanges() or QTableWidget::selectedItems() to check the row index, it still is 1, which is expected to be 0. If you click that 1st row by mouse, result doesn't change.

      You need to select another row then select 1st row, QTableWidget::selectedRanges() or QTableWidget::selectedItems() will return index 0 as the selected row index.

      Attachments

        Issue Links

          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
              missdeer Yang Fan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes