Visibility status of status bar can be referred as if it is visible then it will return True, else False. We can check it by using isVisible method.
Syntax : class_object.status_bar_object.isVisible() Argument : It takes no parameter. Return : It return bool.
Note #1: If we don’t create an object of status bar this property will be false. Note #2: If this method is called inside the constructor, it will always return False, as before showing anything every visible status is False. Code :
Python3
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import sys
class Window(QMainWindow):
def __init__( self ):
super ().__init__()
self .setWindowTitle("Python")
self .setGeometry( 60 , 60 , 600 , 400 )
self .statusBar().showMessage("This is status bar")
self .statusBar().setStyleSheet("border : 3px solid black;")
self .statusBar().setToolTip("Hello ! from status bar")
self .label_1 = QLabel("status bar", self )
self .label_1.move( 100 , 100 )
self .label_1.setStyleSheet("border : 1px solid blue;")
self .label_1.adjustSize()
self .show()
App = QApplication(sys.argv)
window = Window()
t = window.statusBar().isVisible()
print (t)
sys.exit(App. exec ())
|
Output :
True

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
06 Jan, 2023
Like Article
Save Article