Logo Search packages:      
Sourcecode: qt4-x11 version File versions

int QApplication::exec (  )  [static, inherited]

Enters the main event loop and waits until exit() is called, then returns the value that was set to exit() (which is 0 if exit() is called via quit()).

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:
quitOnLastWindowClosed, quit(), exit(), processEvents(), QCoreApplication::exec()

Reimplemented from QCoreApplication.

Definition at line 3332 of file qapplication.cpp.

References QCoreApplication::exec(), and QAccessible::setRootObject().

{
#ifndef QT_NO_ACCESSIBILITY
    QAccessible::setRootObject(qApp);
#endif
    return QCoreApplication::exec();
}


Generated by  Doxygen 1.6.0   Back to index