yesterday example
Qt Code:
  1. #include <QTimer>
  2. #include <QApplication>
  3.  
  4. class MyProcessEventDispatcher: public QObject
  5. {
  6. Q_OBJECT
  7.  
  8. public:
  9. MyProcessEventDispatcher(QObject *parent = 0)
  10. : QObject (parent)
  11. {
  12. connect(&m_timer, SIGNAL(timeout()), SLOT(updateEvents()));
  13. m_timer.setInterval(100);
  14. m_timer.start();
  15. }
  16.  
  17. private slots:
  18. void updateEvents()
  19. {
  20. m_timer.start();
  21. qApp->processEvents();
  22. }
  23.  
  24. private:
  25. QTimer m_timer;
  26. };
  27. #include "main.moc"
  28. int main(int argc, char **argv)
  29. {
  30. QApplication app(argc, argv);
  31. MyProcessEventDispatcher mpee;
  32. //...
  33. return app.exec();
  34. }
To copy to clipboard, switch view to plain text mode 
add this code to yours main.cpp, clean your project and then call qmake. now, when you start compilation main.com will be generated.