diff options
Diffstat (limited to 'gui/widgets')
| -rw-r--r-- | gui/widgets/__pycache__/calendar.cpython-35.pyc | bin | 0 -> 1142 bytes | |||
| -rw-r--r-- | gui/widgets/__pycache__/checkbox.cpython-35.pyc | bin | 0 -> 1043 bytes | |||
| -rw-r--r-- | gui/widgets/__pycache__/double_spinbox.cpython-35.pyc | bin | 0 -> 1209 bytes | |||
| -rw-r--r-- | gui/widgets/__pycache__/label.cpython-35.pyc | bin | 0 -> 702 bytes | |||
| -rw-r--r-- | gui/widgets/__pycache__/line_edit.cpython-35.pyc | bin | 0 -> 1038 bytes | |||
| -rw-r--r-- | gui/widgets/__pycache__/money_spinbox.cpython-35.pyc | bin | 0 -> 1216 bytes | |||
| -rw-r--r-- | gui/widgets/__pycache__/spinbox.cpython-35.pyc | bin | 0 -> 1133 bytes | |||
| -rw-r--r-- | gui/widgets/calendar.py | 13 | ||||
| -rw-r--r-- | gui/widgets/checkbox.py | 12 | ||||
| -rw-r--r-- | gui/widgets/double_spinbox.py | 15 | ||||
| -rw-r--r-- | gui/widgets/label.py | 9 | ||||
| -rw-r--r-- | gui/widgets/line_edit.py | 12 | ||||
| -rw-r--r-- | gui/widgets/money_spinbox.py | 15 | ||||
| -rw-r--r-- | gui/widgets/spinbox.py | 14 |
14 files changed, 90 insertions, 0 deletions
diff --git a/gui/widgets/__pycache__/calendar.cpython-35.pyc b/gui/widgets/__pycache__/calendar.cpython-35.pyc Binary files differnew file mode 100644 index 0000000..fcd150c --- /dev/null +++ b/gui/widgets/__pycache__/calendar.cpython-35.pyc diff --git a/gui/widgets/__pycache__/checkbox.cpython-35.pyc b/gui/widgets/__pycache__/checkbox.cpython-35.pyc Binary files differnew file mode 100644 index 0000000..49f87fc --- /dev/null +++ b/gui/widgets/__pycache__/checkbox.cpython-35.pyc diff --git a/gui/widgets/__pycache__/double_spinbox.cpython-35.pyc b/gui/widgets/__pycache__/double_spinbox.cpython-35.pyc Binary files differnew file mode 100644 index 0000000..31d21df --- /dev/null +++ b/gui/widgets/__pycache__/double_spinbox.cpython-35.pyc diff --git a/gui/widgets/__pycache__/label.cpython-35.pyc b/gui/widgets/__pycache__/label.cpython-35.pyc Binary files differnew file mode 100644 index 0000000..13726bf --- /dev/null +++ b/gui/widgets/__pycache__/label.cpython-35.pyc diff --git a/gui/widgets/__pycache__/line_edit.cpython-35.pyc b/gui/widgets/__pycache__/line_edit.cpython-35.pyc Binary files differnew file mode 100644 index 0000000..8b314d1 --- /dev/null +++ b/gui/widgets/__pycache__/line_edit.cpython-35.pyc diff --git a/gui/widgets/__pycache__/money_spinbox.cpython-35.pyc b/gui/widgets/__pycache__/money_spinbox.cpython-35.pyc Binary files differnew file mode 100644 index 0000000..f55f3da --- /dev/null +++ b/gui/widgets/__pycache__/money_spinbox.cpython-35.pyc diff --git a/gui/widgets/__pycache__/spinbox.cpython-35.pyc b/gui/widgets/__pycache__/spinbox.cpython-35.pyc Binary files differnew file mode 100644 index 0000000..d23e28b --- /dev/null +++ b/gui/widgets/__pycache__/spinbox.cpython-35.pyc 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)) diff --git a/gui/widgets/checkbox.py b/gui/widgets/checkbox.py new file mode 100644 index 0000000..d8e32f1 --- /dev/null +++ b/gui/widgets/checkbox.py @@ -0,0 +1,12 @@ +from PyQt5.QtWidgets import QCheckBox + + +class CheckBox(QCheckBox): + def __init__(self): + super(QCheckBox, self).__init__() + + def get_value(self, ql_type): + return ql_type(self.isChecked()) + + def on_change(self, change_event_function): + self.stateChanged.connect(lambda: change_event_function(self)) diff --git a/gui/widgets/double_spinbox.py b/gui/widgets/double_spinbox.py new file mode 100644 index 0000000..bde201d --- /dev/null +++ b/gui/widgets/double_spinbox.py @@ -0,0 +1,15 @@ +from PyQt5.QtWidgets import QDoubleSpinBox + + +class DoubleSpinBox(QDoubleSpinBox): + def __init__(self): + super(QDoubleSpinBox, self).__init__() + self.setMaximum(2**31 - 1) + self.setMinimum(-self.maximum()) + self.setDecimals(16) + + def get_value(self, ql_type): + return ql_type(self.value()) + + def on_change(self, change_event_function): + self.valueChanged.connect(lambda: change_event_function(self)) diff --git a/gui/widgets/label.py b/gui/widgets/label.py new file mode 100644 index 0000000..a0ce233 --- /dev/null +++ b/gui/widgets/label.py @@ -0,0 +1,9 @@ +from PyQt5.QtWidgets import QLabel + + +class Label(QLabel): + def __init__(self, label): + super(QLabel, self).__init__(label) + + def on_change(self, change_event_function): + pass diff --git a/gui/widgets/line_edit.py b/gui/widgets/line_edit.py new file mode 100644 index 0000000..a87a7b6 --- /dev/null +++ b/gui/widgets/line_edit.py @@ -0,0 +1,12 @@ +from PyQt5.QtWidgets import QLineEdit + + +class LineEdit(QLineEdit): + def __init__(self): + super(QLineEdit, self).__init__() + + def get_value(self, ql_type): + return ql_type(self.text()) + + def on_change(self, change_event_function): + self.textChanged.connect(lambda: change_event_function(self)) diff --git a/gui/widgets/money_spinbox.py b/gui/widgets/money_spinbox.py new file mode 100644 index 0000000..680a432 --- /dev/null +++ b/gui/widgets/money_spinbox.py @@ -0,0 +1,15 @@ +from PyQt5.QtWidgets import QDoubleSpinBox + + +class MoneySpinbox(QDoubleSpinBox): + def __init__(self): + super(QDoubleSpinBox, self).__init__() + self.setPrefix('$') + self.setMaximum(2**31 - 1) + self.setMinimum(-self.maximum()) + + def get_value(self, ql_type): + return ql_type(self.value(), self.prefix()) + + def on_change(self, change_event_function): + self.valueChanged.connect(lambda: change_event_function(self)) diff --git a/gui/widgets/spinbox.py b/gui/widgets/spinbox.py new file mode 100644 index 0000000..1abb63a --- /dev/null +++ b/gui/widgets/spinbox.py @@ -0,0 +1,14 @@ +from PyQt5.QtWidgets import QSpinBox + + +class SpinBox(QSpinBox): + def __init__(self): + super(QSpinBox, self).__init__() + self.setMaximum(2**31 - 1) + self.setMinimum(-self.maximum()) + + def get_value(self, ql_type): + return ql_type(self.value()) + + def on_change(self, change_event_function): + self.valueChanged.connect(lambda: change_event_function(self)) |