在大多数IDE中,自动补全功能不适用于PyQT4和PyKDE4 [英] Autocompletion not working with PyQT4 and PyKDE4 in most of the IDEs

查看:144
本文介绍了在大多数IDE中,自动补全功能不适用于PyQT4和PyKDE4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用python开发等离子体.我已经尝试使用pydev来进行eclipse,使用pythoncomplete,PIDA和Komodo来进行vim的尝试,但是它们都无法自动为方法名称或属于PyQT4或PyKDE4的类的成员提供自动填充.我在IDE的PYTHONPATH列表中的/usr/share/pyshare中添加了文件夹.

I am trying to develop a plasmoid using python. I have tried eclipse with pydev, vim with pythoncomplete, PIDA and also Komodo, but none of them could give me autocmpletion for method names or members for the classes belonging to PyQT4 or PyKDE4. I added the folders in /usr/share/pyshare in the PYTHONPATH list for the IDEs.

我还需要做其他事情吗?

Do I need to do something else ?

推荐答案

有多种方法可以实现,PyQt4为检查IDE的任何对象提供了有关方法名称的足够信息:

There is a number of ways to do it, PyQt4 provides enough information about method names for any object inspecting IDE:

>>> from PyQt4 import QtGui
>>> dir(QtGui.QToolBox) 
['Box', ... contextMenuPolicy', 'count', 'create', 'currentChanged'...]

所有这些功能都是内置的.这意味着您必须推送一些IDE 会引起注意.请注意,已编译的PyQt中没有文档字符串,并且方法具有有趣的签名.

All those functions are built-in. This means that you have to push some IDEs slightly to notice them. Be aware that there are no docstrings in compiled PyQt and methods have a funny signature.

其他可能性是使用在PyQt4生成过程中生成的QScintilla2和.api文件. Eric4 IDE正是为此而准备的.

Other possibility is using QScintilla2 and.api file generated during PyQt4 build process. Eric4 IDE is prepared exactly for that.

< shameless-plug>
您也可以尝试 Komodo IDE /

<shameless-plug>
You can also try Komodo IDE/Komodo Edit and a CIX file (download here) that I hacked together not so long ago:

Komodo 5的安装说明:

Installation instructions for Komodo 5:

  1. 编辑->首选项->代码智能
  2. 添加API目录...
  3. 选择CIX文件,然后按打开"
  4. 没有意义4.

</shameless-plug>

</shameless-plug>

这篇关于在大多数IDE中,自动补全功能不适用于PyQT4和PyKDE4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆