I have got 2 situation when trying to call QStatusBar.showMessage().
– 1st: Got error: TypeError: 'QStatusBar' object is not callable
– 2nd: It does not effect and nothing happen. I got a blank status bar, without any error message.
Here the detail:
The MainWindow class:
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
This module has been imported to the main file. Then, in the main file, I have called QtGui.QStatusBar‘s showMessage() method, and got two following issues.
1. TypeError: ‘QStatusBar’ object is not callable
I have used following code statement to call QtGui.QStatusBar‘s showMessage() method:
self.ui.statusbar().showMessage("You have selected: %s" % self.filename, msecs= 5)
2. A blank statusbar; no effect and there’s any error message.
I have used this code statement:
self.ui.statusbar.showMessage("You have selected: %s" % self.filename, msecs= 5)
I haven’t got any error, but it’s also take no effect.
Someone can help me to figure out that what I have wrong and how to fix it? Thank you!
You use
msecs= 5.This means “show the message for 5 milliseconds”!
Please try with
msecs=5000.