QString text; QStringList errorValue = text.split(QRegExp("[\r\n]"),QString::SkipEmptyParts); 想要去除的格式可以用正则表达式限定。