42 #ifndef QTESTEVENTLOOP_H 43 #define QTESTEVENTLOOP_H 45 #include <QtTest/qtest_global.h> 47 #include <QtCore/qcoreapplication.h> 48 #include <QtCore/qeventloop.h> 49 #include <QtCore/qobject.h> 50 #include <QtCore/qpointer.h> 64 : QObject(aParent),
inLoop(false), _timeout(false), timerId(-1), loop(0) {}
65 inline void enterLoop(
int secs);
69 { killTimer(timerId); timerId = startTimer(secs * 1000); }
83 inline void exitLoop();
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
#define QT_END_NAMESPACE
This macro expands to.
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
The QObject class is the base class of all Qt objects.
The QPointer class is a template class that provides guarded pointers to QObject. ...
void changeInterval(int secs)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QEventLoop class provides a means of entering and leaving an event loop.
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
static QTestEventLoop & instance()
void timerEvent(QTimerEvent *e)
This event handler can be reimplemented in a subclass to receive timer events for the object...
void exit(int returnCode=0)
Tells the event loop to exit with a return code.
The QTimerEvent class contains parameters that describe a timer event.
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
QTestEventLoop(QObject *aParent=0)
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
void killTimer(int id)
Kills the timer with timer identifier, id.