这一段代码错在哪里,执行的时候会出问题
-
@QString srcimgfilename;
QString rawdatafilename;
QStringList filelist;
filelist = QFileDialog::getOpenFileNames(this,tr("选择文件"),".",tr("Text files (.txt);;XML files (.xml)"));
QStringList::const_iterator it = filelist.constBegin();
while(it != filelist.constEnd())
{
leftpointfilename = (*it).toLocal8Bit;
std::cout<<(*it).toLocal8Bit().constData()<<std::endl;
++it;
rightpointfilename = (*it).toLocal8Bit;
std::cout<<(*it).toLocal8Bit().constData()<<std::endl;
}@ -
尝试不用iterator,而用更加方便的foreach伪关键字。
@
foreach( QString fileName, filelist )
{
std::cout << qPrintable( fileName ) << '\n';
}
@