Skip to content
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

Itemviews headers refactoring #2463

Merged
merged 12 commits into from
May 11, 2024
Merged

Itemviews headers refactoring #2463

merged 12 commits into from
May 11, 2024

Conversation

zas
Copy link
Collaborator

@zas zas commented May 10, 2024

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

  • JIRA ticket (optional): PICARD-XXX

Solution

Action

Additional actions required:

  • Update Picard documentation (please include a reference to this PR)
  • Other (please specify below)

zas added 8 commits May 10, 2024 11:22
This was meant to ensure last column hasn't fixed size, but it never worked as intended.
Also header `setStretchLastSection(True)` should prevent the issue anyway so this code isn't needed.
We do not want to loose initial state when locking.
…n defaults

https://doc.qt.io/qt-6/qheaderview.html#restoreState says:
This function returns true if the state was restored; otherwise returns false.
zas added 2 commits May 10, 2024 21:53
- Drop now unneeded _restore_state()
- on restore state, always set columns to defaults before trying to restore previous state
- ensure _init_header() always set columns to defaults and try to restore previous state
…and lock

- if the header state was saved during lock it was actually saving the state sets by locking itself
- new code avoids this, and always save the state before locking
@zas zas marked this pull request as ready for review May 10, 2024 20:10
@zas zas requested a review from phw May 10, 2024 20:10
Copy link
Member

@phw phw left a comment

Choose a reason for hiding this comment

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

Works well, LGTM

@zas zas merged commit 92de44e into metabrainz:master May 11, 2024
45 checks passed
@zas zas deleted the itemviews_headers branch May 11, 2024 08:48
@zas zas mentioned this pull request May 12, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants