开发者

Adding time elapsed instead of just updating

I have on my dialog lineEdit which displays a time elapsed after certain operation finished it's work. So the code structure is following:

void some_f()
{
QTime time;
time.start();
My_Class::do_operation();//this is static fnc
line_edit->setText(QString::number(time.elapsed()));
}

What I cannot understand is how on ea开发者_Python百科rth this is possible:

While debugging all seems ok, every time this fnc is invoked the time elapsed is different but similar (within same range).

Strange things happen when this isn't in debug mode. It looks like time elapsed is ADDED TO PREVIOUS result (previous time). How/why to fix it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜