Ok.
In the header file of your class (probably mainwindow.h):
private:
private:
QTimer *timer;
To copy to clipboard, switch view to plain text mode
In the constructor MainWindow::MainWindow() of your class:
connect(timer, SIGNAL(timeout()), this, SLOT(write_random_image()));
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(write_random_image()));
To copy to clipboard, switch view to plain text mode
In the on_checkBox_clicked() slot:
if (ui->checkBox->isChecked())
timer->start(1000);
else
timer->stop();
if (ui->checkBox->isChecked())
timer->start(1000);
else
timer->stop();
To copy to clipboard, switch view to plain text mode
Also remember to #include <QTimer> somewhere (e.g. in the header file).
Edit: Too slow..
Bookmarks