[PyKDE] QFontDatabase

Phil Thompson phil at river-bank.demon.co.uk
Fri Sep 13 09:15:01 BST 2002


Doug Bell wrote:

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


Thanks - now fixed (including removing support for the obsolete version 
in Qt3).

Phil




More information about the PyQt mailing list