QTimer will works when you have have a event loop (i.e. call exec());, or other way is to explictily process the events by calling QCoreApplication:
rocessEvents(), from the local while loop.
void Thread::run()
{
while(1)
{
// some operations doing inside the loop
if(m_pProbeFailure[i].Value > m_nCuurrent_ADC_Value)
{
if(!m_pTimer[i].isActive())
m_pTimer[i].start();
}
}
}
void Thread::run()
{
while(1)
{
// some operations doing inside the loop
if(m_pProbeFailure[i].Value > m_nCuurrent_ADC_Value)
{
if(!m_pTimer[i].isActive())
m_pTimer[i].start();
}
QCoreApplication::processEvents();
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks