I want to have a class with (among other things) a generic function that after some calcs conects a Qtimer with external function.
I have to declare this external function as a SLOT isn't ? Now, how can I pass this SLOT to the function I want to write ?
class A
public slots:
void actualizamem(long value);
public slots:
void actualizamem(long value);
To copy to clipboard, switch view to plain text mode
and I have another function:
ClassB().w_timer_mem(500,1000, this, SLOT(A:actualizamem(long)));
ClassB().w_timer_mem(500,1000, this, SLOT(A:actualizamem(long)));
To copy to clipboard, switch view to plain text mode
And at aclass B:
void ClassB
::w_timer_mem(long value,
int interval,
QObject *parent,
char * const method
) { if (value <1000)
{
a_timer->setInterval(interval);
QObject::connect(a_timer,
SIGNAL(timeout
()), parent, method
);
a_timer->start();
}
void ClassB::w_timer_mem(long value, int interval, QObject *parent, char * const method) {
if (value <1000)
{
QTimer *a_timer = new QTimer();
a_timer->setInterval(interval);
QObject::connect(a_timer, SIGNAL(timeout()), parent, method);
a_timer->start();
}
To copy to clipboard, switch view to plain text mode
It does not work for me:
Thanks
Bookmarks