[PyKDE] Question about Qt syntax between C++ and python

Jim Bublitz jbublitz at nwinternet.com
Thu Jun 29 19:56:53 BST 2006


On Thursday 29 June 2006 11:09, Michael Sullivan wrote:
> On Thu, 2006-06-29 at 18:44 +0100, Phil Thompson wrote:
> > On Thursday 29 June 2006 6:30 pm, Michael Sullivan wrote:
> > > If I've got a symbolic constant, such as "Qt::AlignHCenter", how would
> > > I write that in python?
> >
> > Qt.AlignHCenter
> >
> > Phil
>
> Here is my program:
>
> #!/usr/bin/env python
>
> import sys
> import qt

>       self.blank[0].setAlignment(Qt.AlignHCenter);
> #      self.blank[0].setFont(QFont("OldEnglish", 16,Qt::Bold, true));

      self.blank[0].setAlignment(qt.Qt.AlignHCenter);
      self.blank[0].setFont(qt.QFont("OldEnglish", 16,qt.Qt::Bold, true));

or:

from qt import Qt, QFont, QWidget ...

      ...

     self.blank[0].setAlignment(Qt.AlignHCenter);
     self.blank[0].setFont(QFont("OldEnglish", 16,Qt::Bold, true));

Jim




More information about the PyQt mailing list