2 seconds after the first picture, the second should appear. How to make a program pause? I tried a lot of things. Either the program hangs, or simply does not work.
void Widget::paintEvent(QPaintEvent *event) { Q_UNUSED(event); QPainter painter(this); painter.setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap)); if(ui->startButton->isChecked()){ painter.setBrush(QBrush(Qt::red, Qt::SolidPattern)); painter.drawRect(20,30, 180, 120); // здесь должна быть пауза painter.setBrush(QBrush(Qt::green, Qt::SolidPattern)); painter.drawEllipse(100, 150, 180, 200); } else if(ui->pauseButton->isChecked()){ } else if(ui->cleanButton->isChecked()){ } } void Widget::on_startButton_clicked() { repaint(); } void Widget::on_pauseButton_clicked() { repaint(); } void Widget::on_cleanButton_clicked() { repaint(); }