⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qeventloop.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
字号:
'\" t.TH QEventLoop 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQEventLoop \- Manages the event queue.SH SYNOPSIS\fC#include <qeventloop.h>\fR.PPInherits QObject..PPInherited by QMotif..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQEventLoop\fR ( QObject * parent = 0, const char * name = 0 )".br.ti -1c.BI "\fB~QEventLoop\fR ()".br.ti -1c.BI "enum \fBProcessEvents\fR { AllEvents = 0x00, ExcludeUserInput = 0x01, ExcludeSocketNotifiers = 0x02, WaitForMore = 0x04 }".br.ti -1c.BI "typedef uint \fBProcessEventsFlags\fR".br.ti -1c.BI "void \fBprocessEvents\fR ( ProcessEventsFlags flags, int maxTime )".br.ti -1c.BI "virtual bool \fBprocessEvents\fR ( ProcessEventsFlags flags )".br.ti -1c.BI "virtual bool \fBhasPendingEvents\fR () const".br.ti -1c.BI "virtual void \fBregisterSocketNotifier\fR ( QSocketNotifier * notifier )".br.ti -1c.BI "virtual void \fBunregisterSocketNotifier\fR ( QSocketNotifier * notifier )".br.ti -1c.BI "void \fBsetSocketNotifierPending\fR ( QSocketNotifier * notifier )".br.ti -1c.BI "int \fBactivateSocketNotifiers\fR ()".br.ti -1c.BI "int \fBactivateTimers\fR ()".br.ti -1c.BI "int \fBtimeToWait\fR () const".br.ti -1c.BI "virtual int \fBexec\fR ()".br.ti -1c.BI "virtual void \fBexit\fR ( int retcode = 0 )".br.ti -1c.BI "virtual int \fBenterLoop\fR ()".br.ti -1c.BI "virtual void \fBexitLoop\fR ()".br.ti -1c.BI "virtual int \fBloopLevel\fR () const".br.ti -1c.BI "virtual void \fBwakeUp\fR ()".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBawake\fR ()".br.ti -1c.BI "void \fBaboutToBlock\fR ()".br.in -1c.SH DESCRIPTIONThe QEventLoop class manages the event queue..PPIt receives events from the window system and other sources. It then sends them to QApplication for prcoessing and delivery..PPQEventLoop 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..PPQEventLoop 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..PPSee also Main Window and Related Classes and Event Classes..SS "Member Type Documentation".SH "QEventLoop::ProcessEvents"This enum controls the types of events processed by the processEvents() functions..TP\fCQEventLoop::AllEvents\fR - All events are processed.TP\fCQEventLoop::ExcludeUserInput\fR - Do not process user input events. ( ButtonPress, KeyPress, etc. ).TP\fCQEventLoop::ExcludeSocketNotifiers\fR - Do not process socket notifier events..TP\fCQEventLoop::WaitForMore\fR - Wait for events if no pending events are available..PPSee also processEvents()..SH "QEventLoop::ProcessEventsFlags"A \fCtypedef\fR to allow various ProcessEvents values to be OR'ed together..PPSee also ProcessEvents..SH MEMBER FUNCTION DOCUMENTATION.SH "QEventLoop::QEventLoop ( QObject * parent = 0, const char * name = 0 )"Creates a QEventLoop object. The \fIparent\fR and \fIname\fR arguments are passed on to the QObject constructor..SH "QEventLoop::~QEventLoop ()"Destructs the QEventLoop object..SH "void QEventLoop::aboutToBlock ()\fC [signal]\fR"This signal is emitted before the event loop calls a function that could block..PPSee also awake()..SH "int QEventLoop::activateSocketNotifiers ()"Activates all pending socket notifiers and returns the number of socket notifiers that were activated..SH "int QEventLoop::activateTimers ()"Activates all Qt timers and returns the number of timers that were activated..PPQEventLoop subclasses that do their own timer handling need to call this after the time returned by timeToWait() has elapsed..PPNote: This function is only useful on systems where \fCselect()\fR 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..SH "void QEventLoop::awake ()\fC [signal]\fR"This signal is emitted after the event loop returns from a function that could block..PPSee also wakeUp() and aboutToBlock()..SH "int QEventLoop::enterLoop ()\fC [virtual]\fR"This function enters the main event loop (recursively). Do not call it unless you really know what you are doing..SH "int QEventLoop::exec ()\fC [virtual]\fR"Enters the main event loop and waits until exit() is called, and returns the value that was set to exit()..PPIt 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..PPGenerally 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..PPTo 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()..PPSee also QApplication::quit(), exit(), and processEvents()..SH "void QEventLoop::exit ( int retcode = 0 )\fC [virtual]\fR"Tells the event loop to exit with a return code..PPAfter this function has been called, the event loop returns from the call to exec(). The exec() function returns \fIretcode\fR..PPBy convention, a \fIretcode\fR of 0 means success, and any non-zero value indicates an error..PPNote that unlike the C library function of the same name, this function \fIdoes\fR return to the caller -- it is event processing that stops..PPSee also QApplication::quit() and exec()..SH "void QEventLoop::exitLoop ()\fC [virtual]\fR"This function exits from a recursive call to the main event loop. Do not call it unless you really know what you are doing..SH "bool QEventLoop::hasPendingEvents () const\fC [virtual]\fR"Returns TRUE if there is an event waiting, otherwise it returns FALSE..SH "int QEventLoop::loopLevel () const\fC [virtual]\fR"Returns the current loop level..SH "void QEventLoop::processEvents ( ProcessEventsFlags flags, int maxTime )"Process pending events that match \fIflags\fR for a maximum of \fImaxTime\fR milliseconds, or until there are no more events to process, which ever is shorter. If this function is called without any arguments, then all event types are processed for a maximum of 3 seconds (3000 milliseconds)..PPThis 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..PPNOTE: Specifying the WaitForMore flag makes no sense, and will be ignored..SH "bool QEventLoop::processEvents ( ProcessEventsFlags flags )\fC [virtual]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPProcesses pending events that match \fIflags\fR. If no events matching \fIflags\fR are available, this function will wait for the next event if the WaitForMore flag is set in \fIflags\fR, otherwise it returns immediately..PPReturns TRUE if an event was processed; otherwise returns FALSE..PPSee also ProcessEvents..SH "void QEventLoop::registerSocketNotifier ( QSocketNotifier * notifier )\fC [virtual]\fR"Registers \fInotifier\fR with the event loop. Subclasses need to reimplement this method to tie a socket notifier into another event loop. Reimplementations \fIMUST\fR call the base implementation..SH "void QEventLoop::setSocketNotifierPending ( QSocketNotifier * notifier )"Marks \fInotifier\fR as pending. The socket notifier will be activated the next time activateSocketNotifiers() is called..SH "int QEventLoop::timeToWait () const"Returns the number of milliseconds that Qt needs to handle its timers or -1 if there are no timers running..PPQEventLoop subclasses that do their own timer handling need to use this to make sure that Qt's timers continue to work..PPNote: This function is only useful on systems where \fCselect()\fR 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..SH "void QEventLoop::unregisterSocketNotifier ( QSocketNotifier * notifier )\fC [virtual]\fR"Unregisters \fInotifier\fR from the event loop. Subclasses need to reimplement this method to tie a socket notifier into another event loop. Reimplementations \fIMUST\fR call the base implementation..SH "void QEventLoop::wakeUp ()\fC [virtual]\fR"\fBNote:\fR This function is thread-safe when Qt is built withthread support.</p>.PPWakes up the event loop..PPSee also awake()..SH "SEE ALSO".BR http://doc.trolltech.com/qeventloop.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qeventloop.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -