[PyQt] Re: Strange PyQt4 behavior

Detlev Offenbach detlev at die-offenbachs.de
Thu May 22 15:05:26 BST 2008


On Donnerstag, 22. Mai 2008, Phil Thompson wrote:
> On Thursday 22 May 2008 2:38:02 pm Detlev Offenbach wrote:
> > Hi,
> >
> > I just discovered, that the following line of code fails.
> >
> > printer.setPageSize(settings.value("UIPreviewer/pagesize").toInt()[0])
> >
> > The error given is "TypeError: argument 1 of QPrinter.setPageSize() has
> > an invalid type". How do I convert an integer to a QPrinter.PageSize
> > (e.g. 0 -> QPrinter.A4)?
>
> Pass the integer to the ctor...
>
>     QPrinter.PageSize(0)
>

Thanks. Seems my PyQt programmins skills are getting a bit rusty.

Regards,
Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the PyQt mailing list