[PyKDE] QFontDatabase

Doug Bell doug101 at xecu.net
Fri Sep 13 02:23:00 BST 2002


There seems to be a problem with the arguments for the
QFontDatabase().families() function when using Qt3.

Under Qt2, the function is defined in the Trolltech documentation as:

    families(bool onlyForLocale=1)

Under Qt3, it is defined as both:

    families()

and:

    families(bool)   [obsolete]

So the "families()" form, without arguments, should work for both.


It works with Qt2:

>>> from qt import *
>>> a = QApplication([])
>>> QFontDatabase().families()
<qt.QStringList instance at 0x816bf04>


but not with Qt3:

>>> from qt import *
>>> a = QApplication([])
Loading required GL library /usr/X11R6/lib/libGL.so.1.2
>>> QFontDatabase().families()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: Insufficient number of arguments to QFontDatabase.families()


And the obsolete version works in Qt3:

>>> from qt import *
>>> a = QApplication([])
Loading required GL library /usr/X11R6/lib/libGL.so.1.2
>>> QFontDatabase().families(1)
<qt.QStringList instance at 0x8156fac>


Obviously, this is a minor problem, but I figured I'd let you know.

Doug.




More information about the PyQt mailing list