#include <Pt/Gui/Application.h>

Public Member Functions | |
| Application () | |
| Initializes this application. | |
| ~Application () | |
| Deletes the platform specific Application object. | |
| ApplicationImpl & | impl () |
| Returns a reference to the platform specific Application object. | |
| void | commitEvent (const Pt::Event &event) |
| void | queueEvent (const Pt::Event &event) |
| void | processEvents () |
| int | run () |
| void | exit () |
| void | dispatchEvent (const Pt::Event &ev) const |
| Receives GUI events for widgets and delivers them to the widget. | |
Public Attributes | |
| Signal< const Pt::Event & > | event |
| The signal to which slots can register themselves to listen for any event that is committed to this application's event loop. | |
A class that implements this interface may contain a main event loop, where event sources can be registered and events from those sources are dispatched to listeners, that were registered to the event loop. Events may for example be operating system events (timer, file system changes) or gui-specific events (like repaint, mouse events).
The application and therefore the event loop is started with a call to run() and can be exited with a call to exit(). After calling exit() the application should terminate.
Events can be committed by calling commitEvent(). Long running operations can call processEvents() to keep the application responsive.
| Application | ( | ) |
Creates the platform specific Application object and stores it in _impl. Connects the event signal to dispatchEvent().
| void dispatchEvent | ( | const Pt::Event & | ev | ) | const |
General events which are sent to the 'event' signal of ptv::Application are passed to this method. If the event is a GUI event, it is sent to the method Widget::event(). From there it may be dispatched to more specific event handling methods. If the event is not a GUI event, it is ignored.
| event | An event that will be dispatched to the corresponding widget. |