python/qt

Boudewijn Rempt boud at rempt.xs4all.nl
Thu Aug 30 14:38:25 EDT 2001


LeoDeBeo <leodebeo at hotmail.com> wrote:
> using qt with python, i have following problem

> i imported qt  'from qt import *'   (every qt-class i use works)
> but when i want to set the alignment of a label, the constants aren't 
> recognized.
> label= QLabel(parent)
> label.setText(string)
> label.setAlignment (AlignCenter)

> complaint: NameError: global name 'AlignCenter' is not defined


That's because the Qt global constants are in the Qt 'class' - use
Qt.AlignCenter.

-- 

Boudewijn Rempt  | http://www.valdyas.org 



More information about the Python-list mailing list