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

Add stubs for Qt modules #2972

Merged
merged 1 commit into from Apr 18, 2024
Merged

Add stubs for Qt modules #2972

merged 1 commit into from Apr 18, 2024

Conversation

maflAT
Copy link
Contributor

@maflAT maflAT commented Mar 27, 2024

Enables editor and type checker support for Qt classes.

This change provides type information to editors and type checkers.

VSCode / Pylance will still report the import statements in the new stubs as missing imports if the given package is not installed. Nevertheless, if at least one of the packages is installed, you can import and use those classes with full auto-complete support.

It would be nice if someone could test if this also works in PyCharm or other editors / type checkers. Unfortunately I'm not able to do so.

Other Tasks

  • Check interaction with VSCode / Pylance
  • Check interaction with PyCharm

Enables editor and type checker support for Qt classes.
@j9ac9k
Copy link
Member

j9ac9k commented Apr 18, 2024

Hi @maflAT

My apologies for not chiming in earlier... thanks for the PR!

This issue has admittedly been a sore point for us for some time... I will test this out right now on both vscode and pycharm 👍🏻

@j9ac9k
Copy link
Member

j9ac9k commented Apr 18, 2024

Can confirm works on vscode:
image

Can confirm working on pycharm

image

Testing on not PyQt6 also works, thanks so much for this PR @maflAT !!!

@j9ac9k j9ac9k merged commit 086024a into pyqtgraph:master Apr 18, 2024
29 checks passed
@maflAT
Copy link
Contributor Author

maflAT commented Apr 18, 2024

@j9ac9k my pleasure, thanks for the help with checking!

@maflAT maflAT deleted the qt_module_stubs branch April 18, 2024 08:14
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