I using QT 4.7.4 embedded lib to run a simple application:
class QTSApplication : public QApplication
{
public:
QTSApplication( int &argc, char **argv) : QApplication(argc, argv)
{
m_nTimerID = QApplication::startTimer(20);
}
virtual void timerEvent(QTimerEvent* pEvent)
{
if(m_nTimerID == -1 || pEvent->timerId() != m_nTimerID)
{
QApplication::timerEvent(pEvent);
}
else
{
int irandomSleepTime = rand() % 60;
usleep(irandomSleepTime*1000);
}
}
~QTSApplication()
{
QApplication::killTimer(m_nTimerID);
}
private:
int m_nTimerID; //timer handler
};
int main(int argc, char *argv[])
{
QTSApplication a(argc, argv);
int ret = a.exec();
return ret;
}
This simple program can cause upto 30% cpu load and last 3 second randomly . The average freqency is 1 time in10 minutes.I have changed the QT version to 4.6.2 and 4.6.3 ,but that does not help.I also patch the QTBUG 7618.It also doesn't work. The linux system kernal running on the dm8168 arm is 3.6.37.