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

Sorting QTableWidget with hidden rows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.11.1
    • Fix Version/s: 5.11.3
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Commits:
       02663718a9da95968a7879b792508b8c0ae699b2

      Description

      I'm using PyQt 5.11.2 for Windows 10 (x64), when the table has more than 1000 rows in it (3000 rows for example), if I hide some of the rows and then call sortItems() or sortByColumn(), those hidden rows with a row number larger than 1001 become visible automatically while others remain hidden. Is this a bug?

      A code snippet to reproduce the issue:

      import sys
      
      from PyQt5.QtCore import *
      from PyQt5.QtGui import *
      from PyQt5.QtWidgets import *
      
      if __name__ == '__main__':
      	app = QApplication(sys.argv)
      
      	test = QMainWindow()
      
      	table = QTableWidget()
      	table.setRowCount(3000)
      	table.setColumnCount(3)
      
      	for i in range(table.rowCount()):
      		table.setItem(i, 0, QTableWidgetItem())
      		table.item(i, 0).setData(Qt.DisplayRole, i)
      
      		table.hideRow(i)
      
      	table.sortByColumn(0, Qt.AscendingOrder)
      
      	test.setCentralWidget(table)
      
      	test.show()
      
      	sys.exit(app.exec())
      

       

        Attachments

        For Gerrit Dashboard: QTBUG-70633
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            chehrlic Christian Ehrlicher
            Reporter:
            blkserene blkserene
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes