I need to set a timer in my serial class, so when the timer triggers, it calls
a slot. I get the following error when I build the program:
error: no matching function for call to ‘QTimer::singleShot(int, rsxxx* const, bool)’
Here's the code segment:
void rsxxx::DieselSwitchOff()
{
if(!DieselSwitchOff_1())
{
qDebug() << "Diesel failed to switch off..";
}
QTimer::singleShot(3000,
this, DieselSwitchOff_2
());
}
void rsxxx::DieselSwitchOff()
{
if(!DieselSwitchOff_1())
{
qDebug() << "Diesel failed to switch off..";
}
QTimer::singleShot(3000, this, DieselSwitchOff_2());
}
To copy to clipboard, switch view to plain text mode
how should DieselSwitchOff be declared? as a public slot or a class member suffices?
also note that the DieselSwitchOff_2 return bool.
I pass the this pointer, as I want to call the singleShot in my rs485 class.
Bookmarks