New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crash on value relation multi-column #54889
Fix crash on value relation multi-column #54889
Conversation
{ | ||
whileBlocking( mTableWidget )->item( j, i )->setCheckState( Qt::PartiallyChecked ); | ||
if ( rowIndex * mColumnCount + columnIndex >= mCache.count() ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the problem that "item" returns null here? It might be cleaner to just go:
if ( currentItem = item( rowIndex, columnIndex) ) { ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the problem, but I find it cleaner this way: why would we want to iterate over a non-existing table item when we already know in advance that the index is overflowing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the logic for sizing mCache and building checkbox widgets based on the size of mCache is somewhere else entirely, and there's a good chance that if someone messes with that logic they won't realise that this code even exists and needs updating accordingly.
e8e4fb9
to
2341d3f
Compare
The backport to
stderr
stdout
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_28 release-3_28
# Navigate to the new working tree
cd .worktrees/backport-release-3_28
# Create a new branch
git switch --create backport-54889-to-release-3_28
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 2341d3f58104012263d64fcf809007e0a736fee3
# Push it to GitHub
git push --set-upstream origin backport-54889-to-release-3_28
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_28 Then, create a pull request where the |
Fix #54164