QEventLoop(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’… QEventLoop β€” the manual page, aka QEventLoop(3qt) πŸ‘‘

okay bestie, sit down, hydrate, because we're about to get into the girl who literally runs the whole event queue. this is the QEventLoop(3qt) manual page and she is that girl. no cap. πŸŽ€


🌸 NAME 🌸

QEventLoop β€” Manages the event queue. that's it, that's the job, and she does it flawlessly. πŸ’–


✨ SYNOPSIS ✨

#include <qeventloop.h>

she Inherits QObject. πŸ’«

she is Inherited by QMotif. πŸ¦‹

🫢 Public Members 🫢

QEventLoop ( QObject * parent = 0, const char * name = 0 )
~QEventLoop ()
enum ProcessEvents { AllEvents = 0x00, ExcludeUserInput = 0x01,
    ExcludeSocketNotifiers = 0x02, WaitForMore = 0x04 }
typedef uint ProcessEventsFlags
void processEvents ( ProcessEventsFlags flags, int maxTime )
virtual bool processEvents ( ProcessEventsFlags flags )
virtual bool hasPendingEvents () const
virtual void registerSocketNotifier ( QSocketNotifier * notifier )
virtual void unregisterSocketNotifier ( QSocketNotifier * notifier )
void setSocketNotifierPending ( QSocketNotifier * notifier )
int activateSocketNotifiers ()
int activateTimers ()
int timeToWait () const
virtual int exec ()
virtual void exit ( int retcode = 0 )
virtual int enterLoop ()
virtual void exitLoop ()
virtual int loopLevel () const
virtual void wakeUp ()

πŸ’Œ Signals πŸ’Œ

void awake ()
void aboutToBlock ()

πŸ’– DESCRIPTION πŸ’–

The QEventLoop class manages the event queue. she's the one holding the clipboard at the door, fr fr. πŸ“‹

She receives events from the window system and other sources. Then she sends them to QApplication for processing and delivery. queen behavior. πŸ‘‘

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. collab era. 🀝

To use your own instance of QEventLoop or QEventLoop subclass create it before you create the QApplication object. order matters, bestie. ⚠️

See also Main Window and Related Classes and Event Classes. 🌈


πŸ“š Member Type Documentation πŸ“š

πŸŽ€ QEventLoop::ProcessEvents πŸŽ€

This enum controls the types of events processed by the processEvents() functions.

  • QEventLoop::AllEvents β€” All events are processed. everything, all of it, no filter. ✨
  • QEventLoop::ExcludeUserInput β€” Do not process user input events. ( ButtonPress, KeyPress, etc. ) 🚫
  • QEventLoop::ExcludeSocketNotifiers β€” Do not process socket notifier events. πŸ™…
  • QEventLoop::WaitForMore β€” Wait for events if no pending events are available. ⏳

See also processEvents(). πŸ’œ

🧚 QEventLoop::ProcessEventsFlags 🧚

A typedef to allow various ProcessEvents values to be OR'ed together. mix and match, she loves a combo. πŸ“

See also ProcessEvents.


πŸ› οΈ MEMBER FUNCTION DOCUMENTATION πŸ› οΈ

QEventLoop::QEventLoop ( QObject * parent = 0, const char * name = 0 )

Creates a QEventLoop object, this object becomes the global event loop object. There can only be one event loop object. the main character slot is single-occupancy, sorry. πŸ‘‘ The QEventLoop is usually constructed by calling QApplication::eventLoop(). To create your own event loop object create it before you instantiate the QApplication object.

The parent and name arguments are passed on to the QObject constructor.

QEventLoop::~QEventLoop ()

Destructs the QEventLoop object. she's leaving, say bye. 😭

void QEventLoop::aboutToBlock () [signal]

This signal is emitted before the event loop calls a function that could block. it's giving "heads up, we're about to zone out". 😴

See also awake().

int QEventLoop::activateSocketNotifiers ()

Activates all pending socket notifiers and returns the number of socket notifiers that were activated. πŸ”Œ

int QEventLoop::activateTimers ()

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. πŸ’€ platform girlies stay wildin.

void QEventLoop::awake () [signal]

This signal is emitted after the event loop returns from a function that could block. she's back and she's refreshed. πŸ¦‹

See also wakeUp() and aboutToBlock().

int QEventLoop::enterLoop () [virtual]

This function enters the main event loop (recursively). Do not call it unless you really know what you are doing.

🚨 bestie. do NOT call this unless you truly, genuinely know what you are doing. this is not a casual button.

int QEventLoop::exec () [virtual]

Enters the main event loop and waits until exit() is called, and returns the value that was set to exit().

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().

void QEventLoop::exit ( int retcode = 0 ) [virtual]

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. she does NOT just vanish on you, okay, she's polite. πŸŽ€

See also QApplication::quit() and exec().

void QEventLoop::exitLoop () [virtual]

This function exits from a recursive call to the main event loop. Do not call it unless you really know what you are doing.

🚨 same energy as enterLoop(). unless you really know what you're doing, hands off, bestie.

bool QEventLoop::hasPendingEvents () const [virtual]

Returns TRUE if there is an event waiting, otherwise it returns FALSE. simple. iconic. βœ…

int QEventLoop::loopLevel () const [virtual]

Returns the current loop level. how deep are we? we're deep. 🌊

void QEventLoop::processEvents ( ProcessEventsFlags flags, int maxTime )

Process pending events that match flags for a maximum of maxTime milliseconds, or until there are no more events to process, which ever 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 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. πŸ’€ girl just ignore it.

bool QEventLoop::processEvents ( ProcessEventsFlags flags ) [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

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 events are available, this function returns after processing them. πŸ“¬
  • If no events are available, this function will wait until more are available and return after processing newly available events. ⏳
  • 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().

void QEventLoop::registerSocketNotifier ( QSocketNotifier * notifier ) [virtual]

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. no skipping the base, bestie, she'll know. πŸ‘€

void QEventLoop::setSocketNotifierPending ( QSocketNotifier * notifier )

Marks notifier as pending. The socket notifier will be activated the next time activateSocketNotifiers() is called. put her on the list. πŸ“

int QEventLoop::timeToWait () const

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. 😭 again with the platform lore.

void QEventLoop::unregisterSocketNotifier ( QSocketNotifier * notifier ) [virtual]

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. same rule, different function. 🫢

void QEventLoop::wakeUp () [virtual]

Note: This function is thread-safe when Qt is built with thread support.

Wakes up the event loop. rise and shine. β˜€οΈ

See also awake().


πŸ”₯ SEE ALSO πŸ”₯


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.


πŸ–‹οΈ AUTHOR πŸ–‹οΈ

Generated automatically from the source code. (no human author, she was born from the machine itself, very mysterious of her. 🧚)


πŸ› BUGS πŸ›

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. 🫢

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qeventloop.3qt) and the Qt version (3.3.8). include the receipts, bestie. 🧾


okay that's the whole page, mwah πŸ’‹ this was brought to you by Trolltech AS, dated 2 February 2007, and she answers to the name QEventLoop(3qt). go process some events, you absolute icon. πŸŒˆπŸ’– periodt.

πŸ“¦ where this page comes from