main — Camelot documentation

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- view »

# main

Main function, to be called to start the GUI interface

class `camelot.view.main.` `Application`(application_admin)

  The camelot application. This class will take care of the order of initialization of various stuff needed to get the application up and running, each of its methods will be called in subsequent order, overwrite any of them to customize its behaviour.

  This class will create the QApplication and call its processEvents method regulary while starting up the application.

  `close_splashscreen`(splash_window, main_window)

    closes the splashcreen on appearance of the main window :param splash_window: the splash screen window, as generated by the show splashcreen function

  `create_main_window`()

    Returns: | a QWidget representing the main window, upon its appearance, the splash

    screen will be closed

  `initialization`()

    Method that is called afther the model has been set up, before the main window is constructed

  `initialization_exception`(exception_info)

    This method is called whenever an exception occurs before the event loop has been started, or if the setup of the model thread failed. By default this pops up a dialog.

    Parameters: | exception_info – a serialized form of the exception

  `load_translations`(application)

    Fill the QApplication with the needed translations :param application: the QApplication on which to install the translator

  `main`()

    the main function of the application, this will call all other functions before starting the event loop

  `pre_initialization`()

    Method that is called before the model thread is started, while the app is still running single threaded.

    The default implementation verifies if the select_database attribute is set to True on the ApplicationAdmin, and if this is the case, present the user with a database selection wizard.

  `set_application_attributes`(application)

    Sets the attributes of the QApplication object :param application: the QApplication object

  `show_splash_message`(splash_window, message)

    Parameters: | message – displays a message on the splash screen, informing

    the user of the status of the application

  `show_splashscreen`()

    Returns: | the splash window

  `start_event_loop`(application)

    Starts the application’s main event loop, wait until it is finished, then exit :param application: the QApplication to run

  `start_model_thread`()

    Launch the second thread where the model lives

`camelot.view.main.` `main`(application_admin)

  shortcut main function, call this function to start the GUI interface with minimal hassle and without the need to construct an Application object. If you need to customize the initialization process, construct an Application subclass and use it’s main method.

  Parameters: | application_admin – object of type ApplicationAdmin (as defined in application_admin.py)

  that specifies the look of the GUI interface

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- view »

Comments
blog comments powered by Disqus