有没有办法将QModelIndex转换为QString?这背后的主要目标是我想处理动态生成的QListView-Items的内容。将QModelIndex转换为QString
QFileSystemModel *foolist = new QFileSystemModel;
foolist->setRootPath(QDir::rootPath());
foolistView->setModel(foolist);
[...]
QMessageBox bar;
QString foolist_selectedtext = foolistView->selectionModel()->selectedIndexes();
bar.setText(foolist_selectedtext);
bar.exec;
这是甚至正确的方式来获得当前选定的项目?
在此先感谢!