【发布时间】:2010-12-20 17:53:09
【问题描述】:
现在我在 QText 浏览器中显示类似 /home/binary/ 的内容。现在我想通过单击此文本打开文件夹。怎么做 ?提前致谢
这是我的示例代码。我正在显示结果 s
bool MainWindow::displayResult(multimap<string,字符串> &resultMap, 字符串 &filePath) { multimap::iterator 迭代器; 布尔文件状态 = 假; int noOfLocFound = 0, forAppending = 0; QString 没有;
noOfLocFound = resultMap.size(); if ( noOfLocFound != 0 ) ui->textBrowser->append( "<i>File found at <b>" + no.setNum (noOfLocFound ) + "位置");
for ( forAppending = 0,iter = resultMap.begin(); iter !=resultMap.end();迭代++, forAppending++) { 字符串文件 = iter->first; string dir = iter->second;
if ( forAppending == 0) filePath.append(dir); else filePath.append(","+dir); QString qdir = QString::fromStdString(dir); cout << "Display"; ui->textBrowser->append( qdir ); fileStatus = true; } if ( fileStatus == false ) { ui->textBrowser->append("File not找到"); 返回假; }
return true; }
【问题讨论】: