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

[FIX] Rank - make sorting setting PyQt6 compatible #6301

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

PrimozGodec
Copy link
Contributor

Issue

Probably fixes #6229

Description of changes

Store the sorting setting as an integer and transform it to Qt.SortOrder when passed to model/wiev

Includes
  • Code changes
  • Tests
  • Documentation

@PrimozGodec PrimozGodec changed the title Rank - make sorting PyQt6 compatible [FIX] Rank - make sorting PyQt6 compatible Jan 17, 2023
@PrimozGodec
Copy link
Contributor Author

@markotoplak I cannot reproduce the issue you reported, but I fixed it to be PyQt6 compatible now. Can you try if the issue is solved for you?

@PrimozGodec PrimozGodec changed the title [FIX] Rank - make sorting PyQt6 compatible [FIX] Rank - make sorting setting PyQt6 compatible Jan 17, 2023
@codecov
Copy link

codecov bot commented Jan 17, 2023

Codecov Report

Merging #6301 (db73b53) into master (feb6341) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6301      +/-   ##
==========================================
- Coverage   87.48%   87.47%   -0.01%     
==========================================
  Files         316      316              
  Lines       68043    68085      +42     
==========================================
+ Hits        59526    59556      +30     
- Misses       8517     8529      +12     

@markotoplak
Copy link
Member

This PR does not fix the problem. I still get

/home/marko/venv310/lib/python3.10/site-packages/orangewidget/settings.py:500: UserWarning: Could not read defaults for widget <class 'Orange.widgets.data.owrank.OWRank'>
The following error occurred:

No module named 'sip'
  warnings.warn("Could not read defaults for widget {0}\n"

after opening Orange with PyQt6 onto settings saved in Orange and PyQt5. But it did fix the opposite problem (saving settings with PyQt6 and opening with PyQt5).

Then I checked what the created defaults file is like. I see sorting<94>K^@<8c>^Csip<94><8c>^N_unpickle_enum<94><93><94><8c>^LPyQt5.QtCore<94><8c> SortOrder in it....

I tried making this int even more "inty" by doing return int(enum) if isinstance(enum, int) else int(enum.value) (one additional int statement), but no, no change.

@PrimozGodec PrimozGodec force-pushed the rank-pyqt6-compat branch 3 times, most recently from 73a6da4 to 6f65964 Compare February 3, 2023 13:51
@markotoplak
Copy link
Member

@PrimozGodec, thanks! I added a commit that just bumps the settings_version. Perhaps not needed, but I like settings structure changes noted somewhere.

@PrimozGodec
Copy link
Contributor Author

@PrimozGodec, thanks! I added a commit that just bumps the settings_version. Perhaps not needed, but I like settings structure changes noted somewhere.

I agree with this change.

@markotoplak markotoplak merged commit a7d215e into biolab:master Feb 9, 2023
@PrimozGodec PrimozGodec deleted the rank-pyqt6-compat branch February 9, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qt6: stored OWRank settings are incompatible
2 participants