Autocomplete not working for PyQt6-3D modules
gentili at mcpnet.ca
Tue May 11 17:59:26 BST 2021
I am using Visual Studio Code with the Python (Pylance) extension to provide autocomplete services.
My environment is configured like so:
The following simple script runs fine and both pylance and pylint find no problems with it:
from PyQt6.Qt3DExtras import Qt3DWindow
from PyQt6.QtWidgets import QApplication
app = QApplication()
view = Qt3DWindow()
However autocomplete is not picking up correct type information for everything under the PyQt6-3D module. In the above example, the QApplication object will produce autocomplete suggestions, but the Qt3DWindow object will not.
I believe it has something to do with the structure of the pyi files for the PyQt modules. The pyi files for the regular PyQt6 modules have their class definitions at the top level, while the pyi files for the PyQt6-3D modules have nested definitions:
So I can still write working code, but the lack of autocomplete makes the process very painful.
Anyone have any experience or understanding of what’s going on here?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt