|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Runs a morph application in a Qt Quick window, on the calling thread. More...
#include <frontend.hpp>
Public Member Functions | |
| Frontend (int &argc, char **argv, FrontendConfig config) | |
| A frontend that runs with the process's command line. | |
| std::string_view | name () const override |
| The name --ui= and MORPH_UI select this frontend by. | |
| int | run (ui::AppSource &source) override |
| Runs the application the source opens until it quits or its window closes. | |
| Public Member Functions inherited from morph::ui::Frontend | |
| Frontend (Frontend const &)=delete | |
| Frontend & | operator= (Frontend const &)=delete |
| Frontend (Frontend &&)=delete | |
| Frontend & | operator= (Frontend &&)=delete |
Runs a morph application in a Qt Quick window, on the calling thread.
run makes, in this order, the QGuiApplication (unless the process has one already), a qt::QtExecutor (the reactive runtime's owner and every bridge handler's callback executor), the runtime, a QtScheduler, the QML engine, the window and the backend, then runs the source through ui::runApp: it opens the source, mounts the shell through FrontendConfig::mountShell when the source is ready, and runs the event loop until AppContext::quit() or the window closes. Teardown is the reverse: the screens, then the source's connections, then the runtime, then Qt. The style is Qt Quick Controls' Basic; on the offscreen platform the window renders in software.
Definition at line 80 of file frontend.hpp.
| morph::qt_quick::Frontend::Frontend | ( | int & | argc, |
| char ** | argv, | ||
| FrontendConfig | config ) |
A frontend that runs with the process's command line.
| argc | The argument count; QGuiApplication keeps a reference to it. |
| argv | The arguments. |
| config | The shell factory, the components and the window title. |
|
nodiscardoverridevirtual |
|
overridevirtual |
Runs the application the source opens until it quits or its window closes.
| source | Opened once the runtime exists, and closed before it is destroyed. |
| std::invalid_argument | when FrontendConfig::mountShell is empty; whatever the source or the shell factory throws. |
Implements morph::ui::Frontend.