c++ - Why can't I connect my Slider Signal with my Label in Qt? -


i trying solve code in qt:

qlabel * laslider = new qlabel("100"); //initial label value laslider->setalignment(qt::aligncenter); layouttop->addwidget(laslider);  qslider * slider = new qslider(qt::horizontal); slider->setminimum(1); slider->setmaximum(200); slider->setvalue(100); layouttop->addwidget(slider);  qobject::connect(&slider, &qslider::valuechanged,                  laslider,                  static_cast<void(qlabel::*)(int)>(&qlabel::setnum)); 

i got following error:

c:***\qt_project\qt_interaction\interaction\main.cpp:60:
error: no matching function call 'qobject::connect(qslider**, void (qabstractslider::)(int), qlabel&, void (qlabel::*)(int))'laslider, static_cast(&qlabel::setnum));

i don't understand wrong code...


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -