[PyKDE] statusBar() in QMainWindow

Jonathan Gardner jgardn at alumni.washington.edu
Fri Feb 15 00:19:11 GMT 2002


I have a widget that is a subclass of the QMainWindow. I want to put some 
QLabels in the status bar.

I can set the text at the bottom with something like this:

self.statusBar().message('Hello!')

I get a square box if I do something like this: (no text in the box)

label = QLabel(self)
self.statusBar().addWidget(label)
label.setText('Hello!')
label.setEnabled(1)

I noticed my problem was that the lable had to have the status bar for a 
parent, so this works fine.

label = QLabel(self.statusBar())
self.statusBar().addWidget(label)
label.setText('Hello!')

Just in case anyone had similar problems...

Jonathan




More information about the PyQt mailing list