PyQt FAQ Introduction

Материал из Wiki.crossplatform.ru

Версия от 11:05, 18 февраля 2009; ViGOur (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Содержание

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.


About 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 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.

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

center

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.


Python

style="float: left;" 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.

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.