magicclass.gui package¶
Submodules¶
magicclass.gui.class_gui module¶
- class magicclass.gui.class_gui.ClassGuiBase(close_on_run, popup_mode, error_mode)[source]¶
Bases:
magicclass.gui._base.BaseGui
- native: QWidget¶
- magicclass.gui.class_gui.make_gui(container: type[_C], no_margin: bool = True) type[_C | ClassGuiBase] [source]¶
Make a ClassGui class from a Container widget. Because GUI class inherits Container here, functions that need overriden must be defined here, not in ClassGuiBase.
magicclass.gui.keybinding module¶
- class magicclass.gui.keybinding.Key(value)[source]¶
Bases:
enum.Enum
An enumeration.
- A = 'a'¶
- Alt = 'alt'¶
- Ampersand = '&'¶
- Apostrophe = "'"¶
- Asterisk = '*'¶
- At = '@'¶
- B = 'b'¶
- Backspace = 'backspace'¶
- C = 'c'¶
- Colon = ':'¶
- Comma = ','¶
- Ctrl = 'ctrl'¶
- D = 'd'¶
- Delete = 'delete'¶
- Dollar = '$'¶
- Down = 'down'¶
- E = 'e'¶
- Equal = '='¶
- Exclam = '!'¶
- F = 'f'¶
- F1 = 'f1'¶
- F10 = 'f10'¶
- F11 = 'f11'¶
- F12 = 'f12'¶
- F2 = 'f2'¶
- F3 = 'f3'¶
- F4 = 'f4'¶
- F5 = 'f5'¶
- F6 = 'f6'¶
- F7 = 'f7'¶
- F8 = 'f8'¶
- F9 = 'f9'¶
- G = 'g'¶
- Greater = '>'¶
- H = 'h'¶
- I = 'i'¶
- J = 'j'¶
- K = 'k'¶
- L = 'l'¶
- Left = 'left'¶
- Less = '<'¶
- M = 'm'¶
- Meta = 'meta'¶
- Minus = '-'¶
- N = 'n'¶
- O = 'o'¶
- P = 'p'¶
- PageDown = 'pagedown'¶
- PageUp = 'pageup'¶
- ParenLeft = '('¶
- ParenRight = ')'¶
- Percent = '%'¶
- Period = '.'¶
- Plus = '+'¶
- Q = 'q'¶
- Question = '?'¶
- R = 'r'¶
- Right = 'right'¶
- S = 's'¶
- Semicolon = ';'¶
- Shift = 'shift'¶
- Slash = '/'¶
- T = 't'¶
- Tab = 'tab'¶
- U = 'u'¶
- Up = 'up'¶
- V = 'v'¶
- W = 'w'¶
- X = 'x'¶
- Y = 'y'¶
- Z = 'z'¶
magicclass.gui.mgui_ext module¶
- class magicclass.gui.mgui_ext.AbstractAction[source]¶
Bases:
magicclass.gui.mgui_ext.mguiLike
QAction encapsulated class with a similar API as magicgui Widget. This class makes it easier to combine QMenu to magicgui.
- changed¶
- native: QAction | QWidgetAction¶
- support_value: bool¶
- property value¶
- class magicclass.gui.mgui_ext.Action(*args, name: Optional[str] = None, text: Optional[str] = None, gui_only: bool = True, **kwargs)[source]¶
Bases:
magicclass.gui.mgui_ext.AbstractAction
- property icon_path¶
- native: QAction | QWidgetAction¶
- property running: bool¶
- support_value: bool = True¶
- property text: str¶
- property value¶
- class magicclass.gui.mgui_ext.FunctionGuiPlus(function: Callable[..., _R], call_button: bool | str | None = None, layout: str = 'vertical', labels: bool = True, tooltips: bool = True, app: AppRef = None, visible: bool = None, auto_call: bool = False, result_widget: bool = False, param_options: dict[str, dict] | None = None, name: str = None, persist: bool = False, **kwargs)[source]¶
Bases:
magicgui.widgets.Container
,Generic
[magicgui.widgets._function_gui._R
]FunctionGui class with a parameter recording functionality etc.
- class magicclass.gui.mgui_ext.PushButtonPlus(text: str | None = None, **kwargs)[source]¶
Bases:
magicgui.widgets.PushButton
A Qt specific PushButton widget with a magicgui bound.
- property background_color¶
- property font_color¶
- property font_family¶
- property font_size¶
- property icon_path¶
- property icon_size¶
- property running: bool¶
- class magicclass.gui.mgui_ext.ToolButtonPlus(text: str | None = None, **kwargs)[source]¶
Bases:
magicclass.gui.mgui_ext.PushButtonPlus
- class magicclass.gui.mgui_ext.WidgetAction(widget: magicclass.gui.mgui_ext._W, label: Optional[str] = None, parent=None)[source]¶
Bases:
magicclass.gui.mgui_ext.AbstractAction
,Generic
[magicclass.gui.mgui_ext._W
]- native: QAction | QWidgetAction¶
- support_value: bool¶
- property text: str¶
- property value¶
- property widget_type¶
magicclass.gui.toolbar module¶
- class magicclass.gui.toolbar.ToolBarGui(parent=None, name: str = None, close_on_run: bool = None, popup_mode: str | PopUpMode = None, error_mode: str | ErrorMode = None, labels: bool = True)[source]¶
Bases:
magicclass.gui._base.BaseGui
,magicclass.gui.mgui_ext.mguiLike
,MutableSequence
Magic class that will be converted into a toolbar
- insert(key: int, obj: magicclass.gui.mgui_ext.AbstractAction) None [source]¶
S.insert(index, value) -- insert value before index
magicclass.gui.utils module¶
- exception magicclass.gui.utils.MagicClassConstructionError[source]¶
Bases:
Exception
This exception will be raised when class definition is not a valid magic-class.