If you want to check if a QCalendarWidget (or any other QWidget derived widget) is currently visible in a PyQt5 application, you can use the isVisible() method.
Here's how you can do it:
import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QCalendarWidget, QPushButton, QVBoxLayout, QWidget class App(QMainWindow): def __init__(self): super().__init__() self.central_widget = QWidget() self.setCentralWidget(self.central_widget) self.layout = QVBoxLayout() self.central_widget.setLayout(self.layout) self.calendar = QCalendarWidget(self) self.layout.addWidget(self.calendar) self.button = QPushButton("Toggle Calendar Visibility", self) self.button.clicked.connect(self.toggle_calendar_visibility) self.layout.addWidget(self.button) def toggle_calendar_visibility(self): # If calendar is visible, hide it; if hidden, show it. if self.calendar.isVisible(): self.calendar.hide() else: self.calendar.show() print(self.calendar.isVisible()) # Print the visibility status if __name__ == '__main__': app = QApplication(sys.argv) mainWin = App() mainWin.show() sys.exit(app.exec_()) In this example, a QCalendarWidget is added to a QMainWindow. There's also a QPushButton that toggles the visibility of the calendar when clicked. Every time the button is clicked, the visibility status of the calendar is printed to the console using self.calendar.isVisible(). If the calendar is currently visible, it will return True, otherwise, it will return False.
selection-sort d3dimage apache-commons-httpclient ups coreclr sql-scripts multipartform-data rdbms web-crawler automation