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

Sorting QTableWidget with hidden rows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.11.3
    • 5.11.1
    • Widgets: Itemviews
    • None
    •  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

            chehrlic Christian Ehrlicher
            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