Skip to content

fix "dataChanged() called with an invalid index range" warning#15937

Merged
daschuer merged 1 commit intomixxxdj:2.5from
ronso0:lib-model-fix-invalid-range-warning
Feb 3, 2026
Merged

fix "dataChanged() called with an invalid index range" warning#15937
daschuer merged 1 commit intomixxxdj:2.5from
ronso0:lib-model-fix-invalid-range-warning

Conversation

@ronso0
Copy link
Copy Markdown
Member

@ronso0 ronso0 commented Feb 2, 2026

Closes #14610

This is a Qt warning that has been introduced in Qt6.9, see QAbstractItemView::dataChanged(topLeft, bottomRight, roles).
In earlier versions it just ignored the invalid range.

Note: regardless the Qt version it still calls viewport->update() which may try to update the entire view, depending on if model cache is enabled / how entensive it is (IIRC)
-> so this may also have been causing GUI issues while Analysis is running, see #15928 / #15930

The only Mixxx implementation that calls this base implementation is WLibraryTableView::dataChanged

if (!bottomRight.isValid()) {
    qWarning() << "bottomRight invalid, sender:" << sender();
}

reveals LibraryTableModel and AnalysisLibraryTableModel btw.

All emit dataChanged() signals we emit look good (topLeft & bottomRight created with reasonable numbers).
Except BaseSqlTableModel::tracksChanged where we are +1 outside the valid column range, hence index() returns an invalid index.

Copy link
Copy Markdown
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

LGTM. Great you have found it. Thank you very much.

@daschuer daschuer merged commit c771f17 into mixxxdj:2.5 Feb 3, 2026
25 checks passed
@ronso0 ronso0 deleted the lib-model-fix-invalid-range-warning branch February 3, 2026 07:30
@wimstefan
Copy link
Copy Markdown

Thank you so much for fixing this log-filling bug!
Will that be merged into main as well?

@acolombier acolombier added this to the 2.5.5 milestone Feb 25, 2026
@github-project-automation github-project-automation Bot moved this to In progress in Releases Feb 25, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Done in Releases Feb 25, 2026
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Feb 25, 2026

Will that be merged into main as well?

Yes, all branches are merged "upwards" frequetly, like 2.5 -> 2.6, 2.6 -> main

@wimstefan
Copy link
Copy Markdown

Yes I noticed that it eventually got merged into main ...
I guess I simply was a bit too impatient 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants