<class name="QEventLoop" doc="/** <p>The <a href="QEventLoop.html#QEventLoop(com.trolltech.qt.core.QObject)"><tt>QEventLoop</tt></a> class provides a means of entering and leaving an event loop.</p> <p>At any time, you can create a <a href="QEventLoop.html#QEventLoop(com.trolltech.qt.core.QObject)"><tt>QEventLoop</tt></a> object and call <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a> on it to start a local event loop. From within the event loop, calling <a href="QEventLoop.html#exit(int)"><tt>exit</tt></a> will force <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a> to return.</p> @see <a href="QAbstractEventDispatcher.html"><tt>QAbstractEventDispatcher</tt></a> */"> <method name="public QEventLoop(com.trolltech.qt.core.QObject parent)" doc="/** <p>Constructs an event loop object with the given <tt>parent</tt>.</p> */"/> <method name="public QEventLoop()" doc="/** <p>Equivalent to <a href="QEventLoop.html#QEventLoop(com.trolltech.qt.core.QObject)"><tt>QEventLoop</tt></a>(0). */"/> <method name="public final int exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags flags)" doc="/** <p>Enters the main event loop and waits until <a href="QEventLoop.html#exit(int)"><tt>exit</tt></a> is called. Returns the value that was passed to <a href="QEventLoop.html#exit(int)"><tt>exit</tt></a>.</p> <p>If <tt>flags</tt> are specified, only events of the types allowed by the <tt>flags</tt> will be processed.</p> <p>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.</p> <p>Generally speaking, no user interaction can take place before calling <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a>. As a special case, modal widgets like <a href="%2E%2E/gui/QMessageBox.html"><tt>QMessageBox</tt></a> can be used before calling <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a>, because modal widgets use their own local event loop.</p> <p>To make your application perform idle processing (i.e&#x2e; executing a special function whenever there are no pending events), use a <a href="QTimer.html"><tt>QTimer</tt></a> with 0 timeout. More sophisticated idle processing schemes can be achieved using <a href="QEventLoop.html#processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>processEvents</tt></a>.</p> @see <tt>QApplication::quit</tt> @see <a href="QEventLoop.html#exit(int)"><tt>exit</tt></a> @see <a href="QEventLoop.html#processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>processEvents</tt></a> */"/> <method name="public final int exec()" doc="/** <p>Equivalent to <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)">exec</tt></a>(AllEvents). */"/> <method name="public final void exit(int returnCode)" doc="/** <p>Tells the event loop to exit with a return code.</p> <p>After this function has been called, the event loop returns from the call to <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a>. The <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a> function returns <tt>returnCode</tt>.</p> <p>By convention, a <tt>returnCode</tt> of 0 means success, and any non-zero value indicates an error.</p> <p>Note that unlike the C library function of the same name, this function <i>does</i> return to the caller -- it is event processing that stops.</p> @see <tt>QCoreApplication::quit</tt> @see <a href="QEventLoop.html#quit()"><tt>quit</tt></a> @see <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a> */"/> <method name="public final void exit()" doc="/** <p>Equivalent to <a href="QEventLoop.html#exit(int)">exit</tt></a>(0). */"/> <method name="public final boolean isRunning()" doc="/** <p>Returns true if the event loop is running; otherwise returns false. The event loop is considered running from the time when <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a> is called until <a href="QEventLoop.html#exit(int)"><tt>exit</tt></a> is called.</p> @see <a href="QEventLoop.html#exec(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>exec</tt></a> @see <a href="QEventLoop.html#exit(int)"><tt>exit</tt></a> */"/> <method name="public final void processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags flags, int maximumTime)" doc="/** <p>Process pending events that match <tt>flags</tt> for a maximum of <tt>maximumTime</tt> 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&#x2e; by using the <a href="QEventLoop.html#ProcessEventsFlag-enum"><tt>ExcludeUserInputEvents</tt></a> flag.</p> <p><b>Notes:</b></p> <ul> <li>This function does not process events continuously; it returns after all available events are processed.</li> <li>Specifying the <a href="QEventLoop.html#ProcessEventsFlag-enum"><tt>WaitForMoreEvents</tt></a> flag makes no sense and will be ignored.</li> </ul> */"/> <method name="public final boolean processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags flags)" doc="/** <p>Processes pending events that match <tt>flags</tt> until there are no more events to process. Returns true if pending events were handled; otherwise returns false.</p> <p>This function is especially useful if you have a long running operation and want to show its progress without allowing user input; i.e&#x2e; by using the <a href="QEventLoop.html#ProcessEventsFlag-enum"><tt>ExcludeUserInputEvents</tt></a> flag.</p> <p>This function is simply a wrapper for QAbstractEventDispatcher::processEvents(). See the documentation for that function for details.</p> */"/> <method name="public final boolean processEvents()" doc="/** <p>Equivalent to <a href="QEventLoop.html#processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>processEvents</tt></a>(AllEvents). */"/> <method name="public final void quit()" doc="/** <p>Tells the event loop to exit normally.</p> <p>Same as exit(0).</p> @see <tt>QCoreApplication::quit</tt> @see <a href="QEventLoop.html#exit(int)"><tt>exit</tt></a> */"/> <method name="public final void wakeUp()" doc="/** <p>Wakes up the event loop.</p> @see <tt>QAbstractEventDispatcher::wakeUp</tt> */"/> <enum name="ProcessEventsFlag" doc="/** <p>This enum controls the types of events processed by the <a href="QEventLoop.html#processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>processEvents</tt></a> functions.</p> @see <a href="QEventLoop.html#processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>processEvents</tt></a> */"> <enum-value name="AllEvents" doc="/** <p>All events except DeferredDelete are processed.</p> */"/> <enum-value name="ExcludeUserInputEvents" doc="/** <p>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 <a href="QEventLoop.html#processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>processEvents</tt></a> is called without the <a href="QEventLoop.html#ProcessEventsFlag-enum"><tt>ExcludeUserInputEvents</tt></a> flag.</p> */"/> <enum-value name="ExcludeSocketNotifiers" doc="/** <p>Do not process socket notifier events. Note that the events are not discarded; they will be delivered the next time <a href="QEventLoop.html#processEvents(com.trolltech.qt.core.QEventLoop.ProcessEventsFlags)"><tt>processEvents</tt></a> is called without the <a href="QEventLoop.html#ProcessEventsFlag-enum"><tt>ExcludeSocketNotifiers</tt></a> flag.</p> */"/> <enum-value name="WaitForMoreEvents" doc="/** <p>Wait for events if no pending events are available.</p> */"/> <enum-value name="X11ExcludeTimers" doc="/** Internal. */"/> <enum-value name="DeferredDeletion" doc="/** <p>Allow objects to be queued for deletion at a later time.</p> */"/> </enum> </class>