I am trying to customize a pushbutton in such a way that when the pushbutton is clicked and held the process will be executed once released the process is stopped ?
Since I am new to qt any help would be appreciated.
I am trying to customize a pushbutton in such a way that when the pushbutton is clicked and held the process will be executed once released the process is stopped ?
Since I am new to qt any help would be appreciated.
Check the signals
of QPushButton
like triggered, pressed released... With these, you can handle your execution of the process!
you can set the button property "autoRepeat" to true. then after that play with the initial delay and the frequency for the signal emission...
you have to connect the signal/slots of course...
and after that you can call the process repeatedly
void MainWindow::on_pushButton_5_clicked()
{
qDebug() << "HelloWorld";
}
"Debug@2020.03.09 08:33:25.897 CET - HelloWorld"
"Debug@2020.03.09 08:33:26.918 CET - HelloWorld"
"Debug@2020.03.09 08:33:27.918 CET - HelloWorld"
"Debug@2020.03.09 08:33:28.918 CET - HelloWorld"
"Debug@2020.03.09 08:33:29.149 CET - HelloWorld"