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

Replace obsolete PyQt5 things #705

Merged
merged 10 commits into from Mar 1, 2022

Conversation

corubba
Copy link
Contributor

@corubba corubba commented Feb 27, 2022

As with every major/minor release, Qt5 and subsequently PyQt5 obsoleted/deprecated a few things (classes, methods, properties, ...) which will be removed with Qt6 and PyQt6. This PR replaces all these obsoleted/deprecated things with their "modern" pendant to future-proof, and preempt instant breakage when moving to PyQt6.

It is replaced by QScreen.
It is more or less drop-in replaced by QFileSystemModel, the only
difference is that the sorting is unconfigurable but seems to
coincide with what we want.
It is replaced by beginResetModel() and endResetModel(). These are
wrapped in a python context manager, so model-resetting code can simply
surrounded with a `with` block and ensure that the end method is called
even in case of an error.
The comment regarding the signal is from 2009, I will *assume* this issue
is fixed by now, especially because endResetModel() will also emit the
modelReset signal.
It is replaced by horizontalAdvance(QString).
It is replaced with `sortByColumn(int, SortOrder)`.
It is replaced by textActivated.
…obsolete

It is replaced by AdjustToContents.
It is replaced by Directory and setting the ShowDirsOnly option.
@corubba corubba added this to the PyQt6 milestone Feb 27, 2022
@sandrotosi
Copy link
Member

great work!

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.

None yet

2 participants