Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QEventLoop class manages the event queue. More...
#include <qeventloop.h>
Inherits QObject.
It receives events from the window system and other sources. It then sends them to QApplication for processing and delivery.
QEventLoop allows the application programmer to have more control over event delivery. Programs that perform long operations can call either processOneEvent() or processEvents() with various ProcessEvent values OR'ed together to control which events should be delivered.
QEventLoop also allows the integration of an external event loop with the Qt event loop. The Motif Extension included with Qt includes a reimplementation of QEventLoop for merging Qt and Motif events together.
To use your own instance of QEventLoop or QEventLoop subclass create it before you create the QApplication object.
See also Main Window and Related Classes and Event Classes.
This enum controls the types of events processed by the processEvents() functions.
See also processEvents().
See also ProcessEvents.
The parent and name arguments are passed on to the QObject constructor.
This signal is emitted before the event loop calls a function that could block.
See also awake().
Activates all pending socket notifiers and returns the number of socket notifiers that were activated.
Activates all Qt timers and returns the number of timers that were activated.
QEventLoop subclasses that do their own timer handling need to call this after the time returned by timeToWait() has elapsed.
Note: This function is only useful on systems where select() is used to block the eventloop. On Windows, this function always returns 0. On MacOS X, this function always returns 0 when the GUI is enabled. On MacOS X, this function returns the documented value when the GUI is disabled.
This signal is emitted after the event loop returns from a function that could block.
See also wakeUp() and aboutToBlock().
This function enters the main event loop (recursively). Do not call it unless you really know what you are doing.
It is necessary to call this function to start event handling. The main event loop receives events from the window system and dispatches these to the application widgets.
Generally speaking, no user interaction can take place before calling exec(). As a special case, modal widgets like QMessageBox can be used before calling exec(), because modal widgets call exec() to start a local event loop.
To make your application perform idle processing, i.e. executing a special function whenever there are no pending events, use a QTimer with 0 timeout. More advanced idle processing schemes can be achieved using processEvents().
See also QApplication::quit(), exit(), and processEvents().
Tells the event loop to exit with a return code.
After this function has been called, the event loop returns from the call to exec(). The exec() function returns retcode.
By convention, a retcode of 0 means success, and any non-zero value indicates an error.
Note that unlike the C library function of the same name, this function does return to the caller -- it is event processing that stops.
See also QApplication::quit() and exec().
This function exits from a recursive call to the main event loop. Do not call it unless you really know what you are doing.
Returns TRUE if there is an event waiting, otherwise it returns FALSE.
Returns the current loop level.
This function is especially useful if you have a long running operation and want to show its progress without allowing user input, i.e. by using the ExcludeUserInput flag.
NOTE: This function will not process events continuously; it returns after all available events are processed.
NOTE: Specifying the WaitForMore flag makes no sense and will be ignored.
Processes pending events that match flags until there are no more events to process.
This function is especially useful if you have a long running operation and want to show its progress without allowing user input, i.e. by using the ExcludeUserInput flag.
If the WaitForMore flag is set in flags, the behavior of this function is as follows:
If the WaitForMore flag is not set in flags, and no events are available, this function will return immediately.
NOTE: This function will not process events continuously; it returns after all available events are processed.
This function returns TRUE if an event was processed; otherwise it returns FALSE.
See also ProcessEvents and hasPendingEvents().
Registers notifier with the event loop. Subclasses need to reimplement this method to tie a socket notifier into another event loop. Reimplementations MUST call the base implementation.
Marks notifier as pending. The socket notifier will be activated the next time activateSocketNotifiers() is called.
Returns the number of milliseconds that Qt needs to handle its timers or -1 if there are no timers running.
QEventLoop subclasses that do their own timer handling need to use this to make sure that Qt's timers continue to work.
Note: This function is only useful on systems where select() is used to block the eventloop. On Windows, this function always returns -1. On MacOS X, this function always returns -1 when the GUI is enabled. On MacOS X, this function returns the documented value when the GUI is disabled.
Unregisters notifier from the event loop. Subclasses need to reimplement this method to tie a socket notifier into another event loop. Reimplementations MUST call the base implementation.
Note: This function is thread-safe when Qt is built withthread support.
Wakes up the event loop.
See also awake().
This file is part of the Qt toolkit. Copyright © 1995-2003 Trolltech. All Rights Reserved.
Copyright © 2003 Trolltech | Trademarks | Qt version 3.1.2
|