Differences between revisions 9 and 15 (spanning 6 versions)
Revision 9 as of 2006-11-20 10:54:50
Size: 3797
Editor: andelf
Comment:
Revision 15 as of 2010-07-27 02:33:16
Size: 3514
Editor: zhuyj
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
''' PyQt ''' <<TableOfContents>>
Line 4: Line 5:
''' PyQt '''
[[TableOfContents]]
Line 7: Line 6:
 * [http://www.trolltech.com/ Troll Tech] --The company which makes Qt, a GUI software toolkit/widget-kit. KDE is based on Qt.  * [[http://www.trolltech.com/|Troll Tech]] --The company which makes Qt, a GUI software toolkit/widget-kit. KDE is based on Qt.
Line 11: Line 10:
== 关于PyQt ==
PyQt是一个Qt UI/XML/SQL C++ 工具包([[http://www.trolltech.com/|Troll Tech]])的全部Python绑定.
Line 12: Line 13:
== 关于PyQt ==
PyQt是一个Qt UI/XML/SQL C++ 工具包([http://www.trolltech.com/ Troll Tech])的全部Python绑定.
[PyQt/AbtPhilThompson] 是一篇简单介绍 PyQt 以及其作者 Phil Thompson 的文章.
Line 15: Line 16:
For more information see [http://wiki.python.org/moin/PyQt PythinInfoWiki]
下载地址: [http://www.riverbankcomputing.co.uk/pyqt/download.php]
最新版本 PyQt v4.1 (基于 Qt v4.2.1 )
/!\ 需先安装 Qt 

For more information [[http://wiki.python.org/moin/PyQt|PythinInfoWiki]]

下载地址: http://www.riverbankcomputing.co.uk/pyqt/download.php

最新版本 PyQt v4.7.4 B)

/!\ 需先安装 Qt
Line 22: Line 27:
Line 24: Line 28:
 * [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]
 * http://www.riverbankcomputing.co.uk/software/pyqt/intro PyQt的官方网站
 * [
[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]]
 * http://wiki.python.org/moin/PyQt Python.org官方维基
 * http://zh.wikipedia.org/zh-cn/PyQt 维基百科关于PyQt的页面
 * [[The_PyQt4_tutorial]] zhuyj翻译
Line 32: Line 40:
 * 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/.
 * TreeLine - a tree-structured PIM http://www.bellz.org/treeline/.
 * ConvertAll - a versatile unit converter http://www.bellz.org/convertall/.
 * rpCalc - a reverse polish notation calculator http://www.bellz.org/rpcalc/.
 * FlyWay - 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 33: Line 52:
  * 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]

== 我的意见 ==
 * PyQt只不过是许多Python Gui Programming方法的一种,所以和其他方法相比,自有其优点与缺点.
 * 关于优点:
    * 有强大的Qt Designer做支持,可以很方便地设计出布局合理的程序.
    * 支持GUI界面的主题,如XP,MAC等等
    * 可以使用C++做扩展
    * ......
== Addition ==
 * 优点:
  * 有强大的Qt Designer支持,可以很方便地设计出布局合理的程序.
  * 支持GUI界面的主题,如XP,MAC等等
  * 可以使用C++做扩展
  * ......
Line 53: Line 59:
    * 中文资料很少,大家可以试着在 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 *
# 这样更方便,而且可以选择导入指定的类
# 如果想导入所有的类和函数
from PyQt4.Qt import *
}}}
  * 中文资料很少,大家可以试着在 google 上搜下. E文资料则大部分为PyQt3.x版,与当前PyQt4的程序有较大差异
  * Win32下运行不方便,需要Qt库支持,不适合用py2exe发布
  * ......
Line 76: Line 64:
Line 77: Line 66:
 * 由 Self:andelf (Feather.And.ELF)创建,你可以通过mail与我交流关于PyQt的问题  * 由 [[andelf]] (Feather.And.ELF)创建,你可以通过mail与我交流关于PyQt的问题

PyQt

什么是Qt

  • Troll Tech --The company which makes Qt, a GUI software toolkit/widget-kit. KDE is based on Qt.

  • Qt是一个完整的C++应用程序开发框架。它包含一个类库,和用于跨平台开发及国际化的工具。Qt API在所有支持的平台上都是相同的,Qt工具在这些平台上的使用方式也一致, 因而Qt应用的开发和部署与平台无关。

关于PyQt

PyQt是一个Qt UI/XML/SQL C++ 工具包(Troll Tech)的全部Python绑定.

[PyQt/AbtPhilThompson] 是一篇简单介绍 PyQt 以及其作者 Phil Thompson 的文章.

PyQt提供了大约300个类以及其中不下5750个函数/方法.

For more information PythinInfoWiki

下载地址: http://www.riverbankcomputing.co.uk/pyqt/download.php

最新版本 PyQt v4.7.4 B)

/!\ 需先安装 Qt

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

一些资料

PyQt应用

Addition

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

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

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

关于

  • andelf (Feather.And.ELF)创建,你可以通过mail与我交流关于PyQt的问题

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