-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Why can't I import QAction normally using qtpy? #474
Comments
Autocomplete for classes such as qtpy.QtWidgets.QAction does not work with the PyQt ref. spyder-ide/qtpy#474 .
Hi @npzs thank you for the feedback! When you say importing My guess is that maybe some sort of config needs to be done over VSCode/Pylance like the one documented for type checking (https://github.com/spyder-ide/qtpy?tab=readme-ov-file#type-checker-integration) but not sure to be honest. Any new info to better understand this is appreciated. Let us know! |
python: 3.12/3.11.7 embedded version
Pyqt: 5.15.10/5.15.9
qtpy:2.4.1
Editor: vscode
I used the embedded version + venv to create a virtual environment. After discovering the problem, I tried to remove the virtual environment and tried changing to different versions of python and pyqt, but the problem remained.
As you can see in vscode, when I use qtpy to import, QAction cannot be recognized normally, but other subclasses are normal, such as QApplication and QMainWindow. There is no problem.
But if you do not use qtpy and import directly from pyqt5, then everything will be normal, including QAction.
How to solve this?
The text was updated successfully, but these errors were encountered: