QListWidget对象内容写入文本
ListWidgetContent = new QListWidget( this);.........
.........
bool TcpClient::saveFile(const QString &fileName)//保存文件
{
QFile file(fileName);
if(!file.open(QFile::WriteOnly | QFile::Text))
{
QMessageBox::warning(this,tr("保存文件"),
tr("无法保存文件 %1:\n %2").arg(fileName)
.arg(file.errorString()));
return false;
}
QTextStream out(&file);
out<<ListWidgetContent->item(2)->text();//第2行写入文本
(如何将ListWidgetContent的内容全部写入文本)
return true;
}
在下刚入门,请大侠帮忙解决下。小生在此谢过 --------------------编程问答-------------------- while(!ListWidgetContent->atEnd())
{
out<<..........
} --------------------编程问答-------------------- 对象没有atEnd()这个函数。能再说详细些吗?谢谢。
补充:移动开发 , Qt