C++ (Qt)ui->lineEdit->setText(ui->lineEdit->text() + (ui->lineEdit->text().isEmpty() ? "" : ",") + QString::number(qrand()%9 + 1))