qt - Display not updating on the QTimer? -
trying display text based on when qtimer fires off...
mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent) { m_label1 = new qlabel("my label not working", this); qtimer* timerdisplay = new qtimer(this); connect(timerdisplay, signal(started()), this, slot(updatedisplay(this))); timerdisplay->start(10); } void updatedisplay(mainwindow* m_this) { qstring out; out = "hello"; m_this->m_label1->settext("asdf"); }
connect(timerdisplay, signal(started()), this, slot(updatedisplay(this)));
this statement failing. , you're ignoring message qt printing on console.
the problem is, can't pass variables in connect
statements that. , for, way? can use this
in updatedisplay
method without need of passing in explicitely!
Comments
Post a Comment