Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.12.0
-
None
-
Windows 10, Visual Studio 2017
-
-
bf1a2ba8e (dev), e4173bc7b (dev), a76ce7b19 (dev), 1b3a7d550 (dev)
Description
I have a QTableView which has thousands of rows. When I use QItemSelectionModel to select multiple rows at the same time, my application will become very lag until the selection status of the QTableView is cleared.
However, if I use Ctrl + A to select all rows of the QTableView, the application's performance will not be affected at all.
I make a simple project to test this problem (see attachment).
The project is a QWidget with a QTableView and a QPushButton. The QTableView has 10,000 rows. Press the button will trigger to select all rows of the QTableView by function selectAll().
The function selectAll() has 4 methods to realize the selection work. Methods 1 & 2 will lead to lag. Methods 3 & 4 works as well as Ctrl + A.
Specifically, if Method 1 or 2 is chosen, the application will be very slow when you tried to move/maximize/minimize the window.
The ultimate goal is to select any rows programmatically, so I must find out the reason for the lag of Method 1 or 2.
Attachments
For Gerrit Dashboard: QTBUG-113137 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
589295,6 | QItemSelectionModel: use range-based for loops | dev | qt/qtbase | Status: MERGED | +2 | 0 |
589611,2 | QItemSelectionModel: simplify QItemSelectionRange::intersects() | dev | qt/qtbase | Status: MERGED | +2 | 0 |
589924,4 | QItemSelectionModel: speed up isColumn/RowSelected | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
590285,6 | QItemSelectionModel: cache calls to QPersistentModelIndex functions | dev | qt/qtbase | Status: MERGED | +2 | 0 |
590960,3 | QItemSelectionModel: cleanup lambdas | dev | qt/qtbase | Status: MERGED | +2 | 0 |