Differences between revisions 5 and 7 (spanning 2 versions)
Revision 5 as of 2008-06-06 01:17:31
Size: 5198
Editor: zhuyj
Comment:
Revision 7 as of 2008-06-11 10:01:49
Size: 5242
Editor: zhuyj
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
关于这篇教程 '''关于这篇教程'''
Line 15: Line 15:
 . ''这是一篇关于 PyQT4教程的介绍。这篇教程的目的介绍PyQT4的工具包。 ''  . 这是一篇关于 PyQT4教程的介绍。这篇教程的目的介绍PyQT4的工具包。
Line 17: Line 18:
'''关于PyQt'''
Line 19: Line 22:
 . ''PyQT是一个生成图形应用程序的工具包。是python语言和成功的Qt库的绑定。Qt库是这个世界上最强大的库之一。官方的PyQt网站在www.riverbankcomputing.co.uk,由Phil Thompson开发。''  . PyQT是一个生成图形应用程序的工具包。是python语言和成功的Qt库的绑定。Qt库是这个世界上最强大的库之一。官方的PyQt网站在www.riverbankcomputing.co.uk,由Phil Thompson开发。
Line 22: Line 26:
 . ''PyQT作为一组python的模块来实现。它包含了超过300个类,将近6000个函数和方法。它是一个多平台的工具包,可以在所有的主流操作系统上运行,包括Unic,Windows和Mac。PyQT采用双协议,开发者可以在GPL和商业授权中选择。以前的版本中,GPL版本只存在于Unic上。从PyQT4开始,GPL协议支持所有的平台。''  . PyQT作为一组python的模块来实现。它包含了超过300个类,将近6000个函数和方法。它是一个多平台的工具包,可以在所有的主流操作系统上运行,包括Unic,Windows和Mac。PyQT采用双协议,开发者可以在GPL和商业授权中选择。以前的版本中,GPL版本只存在于Unic上。从PyQT4开始,GPL协议支持所有的平台。
Line 25: Line 30:
 . ''因为存在很多的类,他们被分成了几个模块''  .因为存在很多的类,他们被分成了几个模块
Line 30: Line 36:
Line 33: Line 40:
Line 56: Line 64:



[[PageComment2]]

Introduction to PyQt4 toolkit

PyQT4工具包介绍

::-- ["zhuyj"] [DateTime(2008-06-06T01:07:27Z)] TableOfContents

1. About this tutorial

关于这篇教程

This is an introductory PyQt4 tutorial. The purpose of this tutorial is to get you started with the PyQt4 toolkit. The tutorial has been created and tested on Linux.

  • 这是一篇关于 PyQT4教程的介绍。这篇教程的目的介绍PyQT4的工具包。

2. About PyQt

关于PyQt

PyQt is a toolkit for creating GUI applications. It is a blending of python programming language and the successfull Qt library. Qt library is one of the most powerful libraries on this planet. If not the most powerful. The official home site for PyQt is on www.riverbankcomputing.co.uk It was developed by Phil Thompson.

  • PyQT是一个生成图形应用程序的工具包。是python语言和成功的Qt库的绑定。Qt库是这个世界上最强大的库之一。官方的PyQt网站在www.riverbankcomputing.co.uk,由Phil Thompson开发。

PyQt is implemented as a set of python modules. It has over 300 classes and almost 6000 functions and methods. It is a multiplatform toolkit. It runs on all major operating systems. Including Unix, Windows and Mac. PyQt is dual licenced. Developers can choose between GPL and commercial licence. Previously, GPL version was available only on Unix. Starting from PyQt version 4, GPL licence is available on all supported platforms.

  • PyQT作为一组python的模块来实现。它包含了超过300个类,将近6000个函数和方法。它是一个多平台的工具包,可以在所有的主流操作系统上运行,包括Unic,Windows和Mac。PyQT采用双协议,开发者可以在GPL和商业授权中选择。以前的版本中,GPL版本只存在于Unic上。从PyQT4开始,GPL协议支持所有的平台。

Because there are a lot of classes available, they have been divided into several modules.

  • 因为存在很多的类,他们被分成了几个模块

attachment:modules.jpg

Figure: PyQt4 Modules

The QtCore module contains the core non-gui functionality. This module is used for working with time, files and directories, various data types, streams, urls, mime types, threads or processes. The QtGui module contains the graphical components and related classes. These include for example buttons, windows, status bars, toolbars, sliders, bitmaps, colors, fonts etc. The QtNetwork module contains the classes for network programming. These classes allow to write TCP/IP and UDP clients and servers. They make the network programming easier and more portable. The QtXml contains classes for working with xml files. This module provides implementation for both SAX and DOM APIs. The QtSvg module provides classes for displaying the contents of SVG files. Scalable Vector Graphics (SVG) is a language for describing two-dimensional graphics and graphical applications in XML. The QtOpenGL module is used for rendering 3D and 2D graphics using the OpenGL library. The module enables seamless integration of the Qt GUI libary and the OpenGL library. The QtSql module provides classes for working with databases.

3. Python

Python is a successful scripting language. It was initially developed by Guido van Rossum. It was first released in 1991. Python was inspired by ABC and Haskell programming languages. Python is a high level, general purpose, multiplatform, interpreted language. Some prefer to call it a dynamic language. It is easy to learn. Python is a minimalistic language. One of it's most visible features is that it does not use semicolons nor brackets. Python uses intendation instead. The most recent version of python is 2.5, which was released in September 2006. Today, Python is maintained by a large group of volunteers worldwide.

The TIOBE Programming Community Index gives us a theoretical usage of various programming languages. Java rules. The C++ language is detroned. But C++ will continue to be used in it's footholds for the coming decades and ther seems to be no real threat for it. We can clearly see specialization among programming languages. Java is used mainly in enterprise projects and portables, C is the king in system programming (OS, device drivers, small apps), PHP rules among small to medium size web sites, Javasript is used on the client site of a web application.

Position

Language

Ratings

1

Java

21.7%

2

C

14.9%

3

Visual Basic

10.7%

4

PHP

10.2%

5

C++

9.9%

6

Perl

5.4%

7

C#

3.4%

8

Python

3.0%

9

JavaScript

2.7%

10

Ruby

2.0%

Python is currently number 8. The Ruby language has made into the toplist. The closest competitors to Python are Ruby and Perl.

4. Python toolkits

For creating graphical user interfaces, python programmers can choose among three decent options. PyGTK, wxPython and PyQt. Which toolkit to choose, depends on the circumstances. There is also another "option", called TkInter. Avoid.

PageComment2

Introduction_简介 (last edited 2010-11-10 00:47:23 by zhuyj)