from
PyQt5.QtWidgets
import
*
from
PyQt5
import
QtCore, QtGui
from
PyQt5.QtGui
import
*
from
PyQt5.QtCore
import
*
import
sys
class
Window(QMainWindow):
def
__init__(
self
):
super
().__init__()
self
.setWindowTitle(
"Python "
)
self
.setGeometry(
100
,
100
,
600
,
400
)
self
.UiComponents()
self
.show()
def
UiComponents(
self
):
self
.calendar
=
QCalendarWidget(
self
)
self
.calendar.setGeometry(
10
,
10
,
400
,
250
)
self
.calendar.setAccessibleName(
"Geek Calendar"
)
self
.calendar.activateWindow()
label
=
QLabel(
self
)
label.setGeometry(
100
,
280
,
250
,
60
)
label.setWordWrap(
True
)
value
=
self
.calendar.isActiveWindow()
label.setText(
"Active Window(Checking inside the class) "
+
str
(value))
App
=
QApplication(sys.argv)
window
=
Window()
check
=
window.calendar.isActiveWindow()
print
(
"Active window : "
+
str
(check))
sys.exit(App.
exec
())