Conventions
Code is always printed in a monospaced
font - like this:
class Test:
def printTest(self):
print self
This also holds for references to bits
of code in the running text. If I cite a function in the text,
it is done like this: printTest() —
i.e., I generally don't quote the parameter list. This makes
it easier to follow the run of the text
Even though PyQt is a cross-platform
toolkit (and I've tested most of the examples on Windows,
too), all development has been done on two Linux computers: my
laptop ‘maldar', and my main system, ‘calcifer',
named after one of the main characters in Diana Wynne Jones'
Howl's Moving Castle. Because
BlackAdder wasn't ready when I wrote this book, I used XEmacs
and Bash (the command line shell) to create and test all
examples. That's why you will often see prompts in
illustrations, and not so often screenshots of
BlackAdder:
boudewijn@maldar:~/doc/pyqt/ch3 > python sigslot.py
Object with ID 135113236 Got signal: message
Object with ID 135115668 Got signal: message
Object with ID 135318532 Got signal: message
boudewijn@maldar:~/doc/pyqt/ch3 >
If you are using Windows, you can use a
DOS box to emulate the Bash shell,
but it won't be quite as convenient.
Finally, it is a widely-honored
convention in programming literature, and especially in Python
books, to make allusions and puns that are related to the
punny names of the product. By rights I should have filled my
code with witty allusions to the British comedy series
Monty Python and
BlackAdder. However, excellent and
essential as these are, it's been long years since I last
watched those on the television, and I don't feel quite up to
it. I've done my best, but don't expect too much!
A note on versions: when I wrote this book
I mostly used the stable 2.x versions of Qt, but as soon as
betas of Qt 3.x became available, I started integrating
information about its improvements in the text. I will note
wherever one version is different from the other. On the
Opendocs webforum for this book you'll find versions of the
examples both for Qt 2.x and Qt 3.x.