Wednesday, November 26, 2008

My PyQt Scribbles (Python and Qt) #1

this first installment of My PyQt Scribbles I will briefly introduce the Qt (PyQt) framework.
We will work with PyQt4 and Python 2.6. I will try as much as possible to test the code either on Linux (Kubuntu 8.10 currently) or Windows XP.
Let's start with a note on the installation.
For Windows users it's quite trivial (as usual) to download the binary from this page of Riverbank website. If you intend to use same tools I'm using then be sure of downloading the package for Python 2.6 (PyQt-Py2.6-gpl-4.4.4-2.exe). For Linux unfortunately there's no binary available but only the source for you to compile. My advice is to install the packages through Synaptict or Adept. Just look for python-qt4 in the repository.
PyQt, as binding of Nokia (former Trolltech) Qt, is a very complete library whose classes have been split is several extension modules.
The most important ones are the following:



And directly from the PyQt reference guide...
QtGui module: This contains the majority of the GUI classes.
QtCore module: This contains the core non-GUI classes, including the event loop and Qt's signal and slot mechanism. It also includes platform independent abstractions for Unicode, threads, mapped files, shared memory, regular expressions, and user and application settings.
QtNetwork module: This module contains classes for writing UDP and TCP clients and servers. It includes classes that implement FTP and HTTP clients and support DNS lookups.
QtXml module: This module contains classes that implement SAX and DOM interfaces to Qt's XML parser.
QtSvg module: This module contains classes for displaying the contents of SVG files.
QtOpenGL module: This module contains classes that enable the use of OpenGL in rendering 3D graphics in PyQt applications.
QtSql module: This module contains classes that integrate with SQL databases. It includes editable data models for database tables that can be used with GUI classes. It also includes an implementation of SQLite.
phonon module: This module contains classes that implement a cross-platform multimedia framework that enables the use of audio and video content in PyQt applications.
Qt module: This module consolidates the classes contained in all of the modules described above into a single module. This has the advantage that you don't have to worry about which underlying module contains a particular class. It has the disadvantage that it loads the whole of the Qt framework, thereby increasing the memory footprint of an application. Whether you use this consolidated module, or the individual component modules is down to personal taste.
We will begin referencing to QtGui directly -thus not calling PyQt directly-. As it happens to many voyages also my journey into PyQt has not an established trail or end. This means we will implement features together and possibly refer to many of the modules later.
As I always say, stay tuned folks!

No comments:

Post a Comment