aboutsummaryrefslogtreecommitdiff
path: root/gui/widgets/calendar.py
diff options
context:
space:
mode:
authorBicker <bickerkards@tuta.io>2019-05-22 17:45:37 +0200
committerBicker <bickerkards@tuta.io>2019-05-22 17:45:37 +0200
commit25314fd2aed81aa5281bc3d93dbcc7919368ebe1 (patch)
tree1995521ee652e419926de5fced0f2e3b655e70fb /gui/widgets/calendar.py
Initial commitHEADmaster
Diffstat (limited to 'gui/widgets/calendar.py')
-rw-r--r--gui/widgets/calendar.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gui/widgets/calendar.py b/gui/widgets/calendar.py
new file mode 100644
index 0000000..5f09834
--- /dev/null
+++ b/gui/widgets/calendar.py
@@ -0,0 +1,13 @@
+from PyQt5.QtWidgets import QCalendarWidget
+
+
+class CalendarWidget(QCalendarWidget):
+ def __init__(self):
+ super(QCalendarWidget, self).__init__()
+
+ def get_value(self, ql_type):
+ date = self.selectedDate()
+ return ql_type(date.day(), date.month(), date.year())
+
+ def on_change(self, change_event_function):
+ self.selectionChanged.connect(lambda: change_event_function(self))