**
****************************************************************************/
-#include <QtCore/QCoreApplication>
+#ifdef QT_GUI_LIB
+# include <QtGui/QGuiApplication>
+#else
+# include <QtCore/QCoreApplication>
+#endif
#include <QtTest/QtTest>
enum {
{ }
private slots:
+ void initTestCase();
void registerTimer();
/* void registerSocketNotifier(); */ // Not implemented here, see tst_QSocketNotifier instead
/* void registerEventNotifiier(); */ // Not implemented here, see tst_QWinEventNotifier instead
return QObject::event(e);
}
+// drain the system event queue after the test starts to avoid destabilizing the test functions
+void tst_QEventDispatcher::initTestCase()
+{
+ QElapsedTimer elapsedTimer;
+ elapsedTimer.start();
+ while (!elapsedTimer.hasExpired(CoarseTimerInterval) && eventDispatcher->processEvents(QEventLoop::AllEvents)) {
+ ;
+ }
+}
+
// test that the eventDispatcher's timer implementation is complete and working
void tst_QEventDispatcher::registerTimer()
{