Differences between revisions 5 and 6
Revision 5 as of 2006-07-19 14:40:19
Size: 2738
Editor: andelf
Comment:
Revision 6 as of 2006-07-20 14:32:43
Size: 3916
Editor: andelf
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
PyQt是一个Qt UI/XML/SQL C++ 工具包([http://www.trolltech.com/ Troll Tech])的全部Python绑定.
PyQt提供了大约300个类以及其中不下5750个函数/方法.
For more information see [http://wiki.python.org/moin/PyQt PythinInfoWiki]
Line 19: Line 22:


== 一些资料 ==
 * [http://blog.donews.com/limodou/category/62890.aspx Limodou BLOG中关于PyQt的内容]
 * [http://www-128.ibm.com/developerworks/cn/linux/l-qt/index.html Qt 和 PyQt 来自DW]
 * [http://www.commandprompt.com/community/pyqt/book1 GUI Programming with Python: QT Edition] (./) 强烈推荐
 * [http://www.devshed.com/c/a/Python/PyQT-Getting-Started/ PyQT: Getting Started]
 * [http://www.cs.usfca.edu/~afedosov/qttut/ Creating GUI Applications in Python with QT]
 * ...........

== PyQt应用 ==

  * Kodos - Python Regular Expressions Debugger [http://kodos.sourceforge.net/].
  * imgSeek - Photo collection manager with content-based search and many other features [http://imgseek.sourceforge.net/].
  * JPA - Jogger Publishing Assistant, Jabber powered weblogging tool [http://jpa.berlios.de/].
  * Tree``Line - a tree-structured PIM [http://www.bellz.org/treeline/].
  * Convert``All - a versatile unit converter [http://www.bellz.org/convertall/].
  * rpCalc - a reverse polish notation calculator [http://www.bellz.org/rpcalc/].
  * Fly``Way - a route planner for pilots [http://www.bellz.org/flyway/].
  * Incubus Data Modeler - Free (GPL) data modeler CASE tool [http://incubus.sf.net]
  * Schevo - a data management system [http://schevo.org]
  * Paythyme - a UK statutory payroll [http://www.paythyme.org.uk]
  * Orange - data mining by visual programming [http://www.ailab.si/orange]
Line 31: Line 57:
== 一些资料收集 ==
 * [http://blog.donews.com/limodou/category/62890.aspx Limodou BLOG中关于PyQt的内容]
 * [http://www-128.ibm.com/developerworks/cn/linux/l-qt/index.html Qt 和 PyQt 来自DW]
 * [http://www.commandprompt.com/community/pyqt/book1 GUI Programming with Python: QT Edition] (./) 强烈推荐
 * [http://www.devshed.com/c/a/Python/PyQT-Getting-Started/ PyQT: Getting Started]
 * [http://www.cs.usfca.edu/~afedosov/qttut/ Creating GUI Applications in Python with QT]
 * ...........

PyQt TableOfContents

什么是Qt

关于PyQt

PyQt是一个Qt UI/XML/SQL C++ 工具包([http://www.trolltech.com/ Troll Tech])的全部Python绑定. PyQt提供了大约300个类以及其中不下5750个函数/方法. For more information see [http://wiki.python.org/moin/PyQt PythinInfoWiki] 下载地址: [http://www.riverbankcomputing.co.uk/pyqt/download.php] 最新版本 PyQt v4 ( Qt v4.1.4 )

/!\ 需先安装 Qt

/!\ 现在所能见到的资料大部分都是 PyQt3.x 的,而且 PyQt3PyQt4 代码有一些不同,比如在导入,运行上. 所以关于安装选择上,自己挑选适合自己的版本.

一些资料

PyQt应用

我的意见

  • PyQt只不过是许多Python Gui Programming方法的一种,所以和其他方法相比,自有其优点与缺点.

  • 关于优点:
    • 有强大的Qt Designer做支持,可以很方便地设计出布局合理的程序.
    • 支持GUI界面的主题,如XP,MAC等等
    • 可以使用C++做扩展
    • ......
  • 缺点:
    • 中文资料很少,大家可以试着在 google 上搜下. E文资料则大部分为PyQt3.x版,与当前PyQt4的程序有较大出入

    • Win32下运行不方便,需要Qt库支持,不适合用py2exe发布
    • ......

关于代码

对于 PyQt3.x ,一般用:

from qt import *

而在 PyQt4 下,导入方式改变:

# 一种是:
from PyQt4 import QtCore, QtGui # 所有自带的Demo文件都是用的这个方法,但不方便

# 所以我们推荐另种:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
# 这样更方便,而且可以选择导入指定的类

(!) 可以在PyQt自带的Demo里找到很多例子,靠看Demo学习也是一种不错的方法.

关于

  • andelf (Feather.And.ELF)创建

  • 最近想法: 东西还是新的好,所以想把某些文档中代码的 PyQt4 版整出来

PyQt (last edited 2010-07-27 02:34:17 by zhuyj)