I dont know very well what is happen....
I have a class with some utilities, one of them is a cronometer.
W_qtutil *w_qt=new W_qtutil();
w_qt->time_start_crono(ui->my_label);
W_qtutil *w_qt=new W_qtutil();
w_qt->time_start_crono(ui->my_label);
To copy to clipboard, switch view to plain text mode
This works .
But this one does not :
W_qtutil w_qt;
w_qt.time_start_crono(ui->my_label);
W_qtutil w_qt;
w_qt.time_start_crono(ui->my_label);
To copy to clipboard, switch view to plain text mode
void W_qtutil
::time_start_crono(QWidget *indicador
) { m_timer->setInterval(1000);
QObject::connect(m_timer,
SIGNAL(timeout
()),
this,
SLOT(time_update_crono
()));
m_timer->start();
}
void W_qtutil::time_start_crono(QWidget *indicador) {
m_timer = new QTimer();
m_timer->setInterval(1000);
QObject::connect(m_timer, SIGNAL(timeout()), this, SLOT(time_update_crono()));
m_timer->start();
}
To copy to clipboard, switch view to plain text mode
(m_timer is public, and declared at .h section)
Any idea ?
Bookmarks