Reputation: 243
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.
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.
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)
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!
Upvotes: 1
Views: 2330
Reputation: 11
You need to remove the '()' behind 'statusbar' because it is isn't a method.
Upvotes: 0
Reputation: 2564
You use msecs= 5
.
This means "show the message for 5 milliseconds"!
Please try with msecs=5000
.
Upvotes: 1