8.2.3. The CustomApp base class

CustomApp([parent, tree])

Base Class to ease the implementation of User Interfaces

class pymodaq_gui.utils.custom_app.CustomApp(parent=None, tree=None)[source]

Base Class to ease the implementation of User Interfaces

Inherits the MixIns ActionManager and ParameterManager classes. You have to subclass some methods and make concrete implementation of a given number of methods:

  • setup_actions: mandatory, see pymodaq.utils.managers.action_manager.ActionManager

  • value_changed: non mandatory, see pymodaq.utils.managers.parameter_manager.ParameterManager

  • child_added: non mandatory, see pymodaq.utils.managers.parameter_manager.ParameterManager

  • param_deleted: non mandatory, see pymodaq.utils.managers.parameter_manager.ParameterManager

  • setup_docks: mandatory

  • setup_menu: non mandatory

  • connect_things: mandatory

Parameters:

parent (Union[DockArea, QMainWindow, QWidget])

See also

pymodaq.utils.managers.action_manager.ActionManager, pymodaq.utils.managers.parameter_manager.ParameterManager, pymodaq.utils.managers.modules_manager.ModulesManager

Methods

connect_things()

Connect actions and/or other widgets signal to methods

do_things_after_ui_setup()

Non mandatory method to be subclassed in order to do things after the UI setup

quit_fun()

Method to be subclassed in order to define a custom quit function

setup_docks()

Mandatory method to be subclassed to setup the docks layout

setup_menu([menubar])

Non mandatory method to be subclassed in order to create a menubar

log_signal

setup_ui

connect_things()[source]

Connect actions and/or other widgets signal to methods

do_things_after_ui_setup()[source]

Non mandatory method to be subclassed in order to do things after the UI setup

quit_fun()[source]

Method to be subclassed in order to define a custom quit function

setup_docks()[source]

Mandatory method to be subclassed to setup the docks layout

Examples

>>>self.docks[‘ADock’] = gutils.Dock(‘ADock name’) >>>self.dockarea.addDock(self.docks[‘ADock’]) >>>self.docks[‘AnotherDock’] = gutils.Dock(‘AnotherDock name’) >>>self.dockarea.addDock(self.docks[‘AnotherDock’’’], ‘bottom’, self.docks[‘ADock’])

See also

pyqtgraph.dockarea.Dock

setup_menu(menubar=None)[source]

Non mandatory method to be subclassed in order to create a menubar

create menu for actions contained into the self._actions, for instance:

Examples

>>>file_menu = self._menubar.addMenu(‘File’) >>>self.affect_to(‘load’, file_menu) >>>self.affect_to(‘save’, file_menu)

>>>file_menu.addSeparator() >>>self.affect_to(‘quit’, file_menu)

See also

pymodaq.utils.managers.action_manager.ActionManager