简体   繁体   English

使用PyQt4自动导入PyDev

[英]PyDev auto import with PyQt4

In PyDev I can type a class name, press Control + 1 and select from the dropdown menu the "import XY" entry and Pydev will automatically add an import statement for me. 在PyDev中,我可以键入一个类名,按Control + 1并从下拉菜单中选择“ import XY”条目,Pydev将自动为我添加一个import语句。 This works with classes coming from any .py module. 这适用于来自任何.py模块的类。 But it does not work with PyQt4, although I added PyQt4 to the forced builtins. 尽管我在强制内置程序中添加了PyQt4,但是它不适用于PyQt4。 Has someone gotten this to work? 有人得到这个工作吗?

Doing it the reverse way works: 以相反的方式进行操作:

from PyQt4 import QtCore
QtCore.[autocomplete works!]

Using Python 2.6.8, PyQt 4.8.3, Eclipse 3.7 and Pydev 2.6 on Windows XP 64 SP 2. All packages are installed with the standard distribution installer. 在Windows XP 64 SP 2上使用Python 2.6.8,PyQt 4.8.3,Eclipse 3.7和Pydev 2.6。所有软件包均通过标准分发安装程序安装。

This is the same issue as in this question and it was answered by the plugin's author: 这个问题与此问题相同,插件的作者回答了这个问题:

PyDev organize imports PyQt4 PyDev组织进口PyQt4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM