QEventLoop Class Reference |
Constant | Value | Description |
---|---|---|
QEventLoop::AllEvents | 0x00 | All events are processed |
QEventLoop::ExcludeUserInputEvents | 0x01 | Do not process user input events, such as ButtonPress and KeyPress. Note that the events are not discarded; they will be delivered the next time processEvents() is called without the ExcludeUserInputEvents flag. |
QEventLoop::ExcludeSocketNotifiers | 0x02 | Do not process socket notifier events. Note that the events are not discarded; they will be delivered the next time processEvents() is called without the ExcludeSocketNotifiers flag. |
QEventLoop::WaitForMoreEvents | 0x04 | Wait for events if no pending events are available. |
QEventLoop::DeferredDeletion | 0x10 | Allow objects to be queued for deletion at a later time. |
QEventLoop::X11ExcludeTimers | 0x08 |
The ProcessEventsFlags type is a typedef for QFlags<ProcessEventsFlag>. It stores an OR combination of ProcessEventsFlag values.
See also processEvents().
Constructs an event loop object with the given parent.
Destroys the event loop object.
Enters the main event loop and waits until exit() is called. Returns the value that was passed to exit().
If flags are specified, only events of the types allowed by the flags will be processed.
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 use their own 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 sophisticated 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 returnCode.
By convention, a returnCode 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 QCoreApplication::quit(), quit(), and exec().
Returns true if the event loop is running; otherwise returns false. The event loop is considered running from the time when exec() is called until exit() is called.
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 ExcludeUserInputEvents flag.
This function is simply a wrapper for QAbstractEventDispatcher::processEvents(). See the documentation for that function for details.
This is an overloaded member function, provided for convenience.
Process pending events that match flags for a maximum of maxTime milliseconds, or until there are no more events to process, whichever is shorter.
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 ExcludeUserInputEvents flag.
Notes:
Tells the event loop to exit normally.
Same as exit(0).
See also QCoreApplication::quit() and exit().
Wakes up the event loop.
See also QAbstractEventDispatcher::wakeUp().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.1 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com