Why Slot is not getting called when timer is timeout
-
m_Timer=new QTimer();
m_Timer->setInterval(1000);
connect(m_Timer, SIGNAL(timeout()), this, SLOT(flashColor()));void CIndicator::setBIsFlash(bool bIsFlash)
{
m_bIsFlash = bIsFlash;
if(m_bIsFlash)
{
m_Timer->start();
}
else
{
m_Timer->stop();
}
}void CIndicator::flashColor()
{
if(getQcIndicatorColor() != getQcIndicatorFlashColor())
{
setQcIndicatorColor(getQcIndicatorFlashColor());
}
else
{
setQcIndicatorColor(getQcIndicatorColorBKP());
}
}I am sure than timer is starting
-
@JonB I would guess the slot is not declared as such so it's not found during runtime. That's the price to pay by not using the pmf syntax nowadays...
-
@Christian-Ehrlicher said in Why Slot is not getting called when timer is timeout:
@JonB I would guess the slot is not declared as such so it's not found during runtime
I have never used them, would that not produce some runtime warning message?
I think the runtimeconnect()
would at least return that error condition? -
@JonB said in Why Slot is not getting called when timer is timeout:
would that not produce some runtime warning message?
It will but only if you look at the console...🙂
-
@ndiwan said in Why Slot is not getting called when timer is timeout:
@JonB I just noticed that SLOT fnction is getting called
How did you notice that? Did you put in debug statement or rely on seeing the color change?
Otherwise if this is not your whole program then follow @Pl45m4's advice.