Skip to content

(fix) Tracks: avoid GUI lag when restoring large track selections - #15973

Merged
ywwg merged 1 commit into
mixxxdj:2.5from
ronso0:tracks-restore-selection-performance-fix
Feb 26, 2026
Merged

(fix) Tracks: avoid GUI lag when restoring large track selections#15973
ywwg merged 1 commit into
mixxxdj:2.5from
ronso0:tracks-restore-selection-performance-fix

Conversation

@ronso0

@ronso0 ronso0 commented Feb 12, 2026

Copy link
Copy Markdown
Member

To reproduce:

  • add many tracks (2000+) to a crate
  • select that crate, select all tracks
  • go to Tracks or any other view
  • go back to that crate
    -> enormous GUI lag until/when crate content is loaded

Issue: selecting each row individually fires maaany selectionChanged() signals and apparently keeps WTrackTableView busy for way too long.

Fix: create a QItemSelection with one or more continouos QItemSelectionRanges, then push that to the QItemSelectionModel -> one selectionChanged() signal

@github-actions github-actions Bot added the ui label Feb 12, 2026
}
}
pSelectionModel->select(newSelection,
QItemSelectionModel::Select | QItemSelectionModel::Rows);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: all this only works because the list returned by QItemSelectionMdel::selectedRows() is sorted by row number

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was puzzled if this is the case. Can you add this as a source code comment?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, will add a comment. the docs aren't explicit about this so I looked it up in the Qt sources
selectedRows() and QItemSelectionRange

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@ronso0
ronso0 force-pushed the tracks-restore-selection-performance-fix branch from 54b614d to a89d377 Compare February 12, 2026 23:57
@ronso0 ronso0 changed the title (fxi) Tracks: avoid GUI lag when restoring large track selections (fix) Tracks: avoid GUI lag when restoring large track selections Feb 15, 2026
@ronso0 ronso0 added the library label Feb 15, 2026
@ronso0 ronso0 added this to the 2.6.0 milestone Feb 16, 2026
Comment thread src/widget/wlibrarytableview.cpp Outdated
@ronso0
ronso0 force-pushed the tracks-restore-selection-performance-fix branch from a89d377 to 5629def Compare February 20, 2026 22:22
@ronso0 ronso0 modified the milestones: 2.6.0, 2.5.5 Feb 25, 2026
@ronso0

ronso0 commented Feb 25, 2026

Copy link
Copy Markdown
Member Author

✔️ and all green. Merge?

@ywwg
ywwg merged commit 707f786 into mixxxdj:2.5 Feb 26, 2026
13 checks passed
@ronso0
ronso0 deleted the tracks-restore-selection-performance-fix branch February 26, 2026 14:13
@github-project-automation github-project-automation Bot moved this to In progress in Releases Mar 5, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Done in Releases Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants