Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Get bool result of qButton when this is pressed
Isidro Perla last edited by
Hello, i need help to obtain the boolean result in a if conditional of a button state.
I have a var called restart, and i need to save a bolean value when i press the button, if is pressed i will save true, if it´s not pressed i will save false.
I need that, because i'm sending in the constructor the value of restart, and i need to capture the moment when is true, becuase later when I release the button the value will be false.
myOGLW = new MyOpenGLWidget(m_sB,k_sB,b_sB,t_cB,pauser,restart,opc);
I hope that can you help whit this!!
Pl45m4 last edited by Pl45m4
Use signals & slots to send a signal to your
MyOpenGLWidgetwhich will cause a restart.
Something like this (in your MainWindow)
connect(ui->pushbutton_restart, &QPushButton::clicked, myOGLW, &MyOpenGLWidget::restart);
Then, make your widget reset / restart itself (in