OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio


Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> Learning Pyqt, Useful links
post Dec 8 2004, 06:16 AM
Post #1

Group: Members
Posts: 329
Joined: 1-July 04
Member No.: 3,880

Python plus PyQt is a great way to develop Zaurus apps. Python is (IMHO) much easier to learn and work with than C++, but Qt (the class library for Zaurus GUI apps that PyQt "wraps") has a bit of a learning curve. It's not difficult, but if you're just getting started, you'll likely need some references.

If you're new to Python, you'll want to get a handle on the basics of the language before you dive into any PyQt stuff. Dive Into Python is available both online and in hardcopy and provides an excellent introduction to Python for folks coming to Python with experience in other programming languages. The book teaches by example and does a pretty good job of zeroing in on core Python concepts.

Once you have a handle on Python basics, check out the book GUI Programming with Python: QT Edition by Boudewijn Rempt. You can read the whole book online at http://www.opendocs.org/pyqt or snag a hardcopy from your favorite bookstore (ISBN: 0-97003300-4-4). This book is a tutorial that does a pretty good job of walking you through the basics of creating apps with Python and PyQt.

PyQt is a very "thin" wrapper around the Qt C++ class library. The Python classes in PyQt have a one-to-one correlation with the C++ classes in Qt. Trolltech's Qt Reference Documentation is outstanding. Every method in every class is documented and everything is nicely hyperlinked making it easy browse up and down the inheritance trees, type definitions, etc. It's not a tutorial, but once you understand the Qt basics, you can learn a lot by browsing this reference. Note that there are many versions of Qt. The link above takes you to the 2.3 docs which is what the Zaurus Qt libs are derived from.

Qtopia (also from Trolltech) is the GUI "shell" on the Zaurus. Qtopia is to Qt as Windows is to Win32. Qtopia extends some of the Qt base classes so that they pick up extra functionality on the Zaurus. For example the base class for a Qt application is QApplication but apps on the Zaurus should actually use the QPEApplication class from Qtopia. That's going to sound mighty confusing if you're not familiar with object oriented programming, but as you come up to speed on Qt development it will start to make sense. Trolltech has a Qtopia reference that you may find useful. That link is actually for the 1.6 version which is newer than the 1.5 version on the Zaurus. The 1.5 version docs appear to be long gone, but for most things the 1.6 docs are close enough.

There are probably lots of other good references and tutorial out there. Those are what I used. If you know of others that you think are worthwhile, post links in this topic.
Go to the top of the page
+Quote Post
post Dec 8 2004, 07:38 AM
Post #2

Group: Members
Posts: 1,495
Joined: 12-November 03
From: Germany
Member No.: 907

When you are capable of reading and understanding german, then I'd like to recommend a fantastic german book called "Python und GUI-Toolkits" (Python and GUI Toolkits), MITP 2002, which contains information about GUI-Toolkits in general and how to create full fledged applications with the following toolkits:
  • Tkinter
  • wxPython
  • PyGTK-2
  • PyQt
The author describes how to seperate application logics from datekeeping and introduces a contact management application which is written with each one of the presented toolkits in a dedicated chapter. That way you not only learn a good deal about every individual toolkit, but you also learn what all toolkits have in common and what differences there are.

The chapter about PyQt can be used to learn writing PyQt applications on the Zaurus. You just need to substitute the QApplication object with a QPEApplication object.

Ok, enough for that shameless self promotion. tongue.gif

Unfortunately there is no english version - if I were to write another book like that, I would write it in english, since the german Python market is pretty small.
Go to the top of the page
+Quote Post
post Dec 8 2004, 11:01 AM
Post #3

Group: Members
Posts: 50
Joined: 10-November 03
Member No.: 832

Thanks for the info guys. I wasn't sure what the difference between Qtopia and Qt was. Using widgets that aren't at an exact spot is a little weird for me (I'm used to Visual Basic), but it doesn't seem too bad.
Go to the top of the page
+Quote Post
post Dec 8 2004, 07:00 PM
Post #4

Group: Members
Posts: 409
Joined: 7-November 03
Member No.: 811

I also want to recommend to purchase a copy of PyQtDoc from theKompany. It is a very good on-line reference for effective programming when using qt classes that are wrapped by PyQt.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 26th May 2018 - 08:06 AM