from
PyQt5.QtWidgets
import
*
from
PyQt5
import
QtCore, QtGui
from
PyQt5.QtGui
import
*
from
PyQt5.QtCore
import
*
import
sys
class
Calendar(QCalendarWidget):
def
__init__(
self
, parent
=
None
):
super
(Calendar,
self
).__init__(parent)
class
Window(QMainWindow):
def
__init__(
self
):
super
().__init__()
self
.setWindowTitle(
"Python "
)
self
.setGeometry(
100
,
100
,
650
,
400
)
self
.UiComponents()
self
.show()
def
UiComponents(
self
):
self
.calendar
=
Calendar(
self
)
self
.calendar.setGeometry(
50
,
10
,
400
,
250
)
self
.calendar.setCursor(Qt.PointingHandCursor)
action1
=
QAction(
"Geek"
,
self
)
action2
=
QAction(
"Python"
,
self
)
action_list
=
[action1, action2]
self
.calendar.addActions(action_list)
action_mid
=
QAction(
"BTech"
,
self
)
self
.calendar.insertAction(action2, action_mid)
self
.label
=
QLabel(
self
)
self
.label.setGeometry(
100
,
280
,
300
,
100
)
self
.label.setWordWrap(
True
)
value
=
self
.calendar.actions()
self
.label.setText(
"Actions : "
+
str
(value))
App
=
QApplication(sys.argv)
window
=
Window()
sys.exit(App.
exec
())