你要这样的效果?
代码:
QString text = ui->textEdit->toPlainText(); QStringList number_list = text.split("\n"); for (int i = 0; i < number_list.size(); ++i) { qDebug() << number_list.at(i).toDouble(); }