|
cut 3.3.0
|
The class creates Numerical Units Menu to change displayed units in the application. More...
Public Member Functions | |
| QAction | get_menu (self, str title, *AppUnit units) |
| Creates QAction that can be attached to existing QMenu. | |
| autoconfigure (self, QWidget|list[QWidget] ui_obj) | |
| Searches for widget of QeAngleLabel and QeAngleEditLine type and connects them to unitChanged signal. | |
| handle_unit_change (self, widget, AppUnit unit) | |
| Performs unit change of QeAngleLabel and QeAngleEditLine widgets. | |
| handle_dart_board_unit_change (self, widget, AppUnit unit) | |
| Performs unit change of QeDartBoard widgets. | |
| set_unit (self, AppUnit unit) | |
| Checks desired unit in the menu. | |
| on_selection_changed (self, action) | |
| Handles change in unit selection when unit action is toggled. | |
The class creates Numerical Units Menu to change displayed units in the application.
| qenumericalunitsmenu.QeNumericalUnitsMenu.autoconfigure | ( | self, | |
| QWidget | list[QWidget] | ui_obj ) |
Searches for widget of QeAngleLabel and QeAngleEditLine type and connects them to unitChanged signal.
| ui_obj | QWidget object or list of QWidget objects from which QeAngleLabel, QeAngleLineEdit and QeDartBoard Children are retrieved and connected to 'unitChanged' so that the widgets react to unit change |
| QAction qenumericalunitsmenu.QeNumericalUnitsMenu.get_menu | ( | self, | |
| str | title, | ||
| *AppUnit | units ) |
Creates QAction that can be attached to existing QMenu.
:param title str title of the action :param *units sequence of units to be available in the menu
| qenumericalunitsmenu.QeNumericalUnitsMenu.handle_dart_board_unit_change | ( | self, | |
| widget, | |||
| AppUnit | unit ) |
Performs unit change of QeDartBoard widgets.
The method handles QeDartBoard class separately to provide robustness
| qenumericalunitsmenu.QeNumericalUnitsMenu.set_unit | ( | self, | |
| AppUnit | unit ) |
Checks desired unit in the menu.
Helper method to set unit programatically (mostly at application start). unitChanged signal has to be emmited explicitly here, because QActionGroup accepts only user-triggered changes, so action.setChecked(True) won't trigger QActionGroup