如何通过QFileSystemModel获取文件路径? 通过选择模型选择仅返回文件名或驱动器名称。
请注意,仅文件名是不够的。 需要整个文件路径。
How to get a filepath via QFileSystemModel? Selecting via selection model returns just file name, or drive name.
Note, that just file name isn't enough. Whole filepath is needed.
最满意答案
在qt网站上: http : //doc.qt.io/qt-5/qfilesystemmodel.html
QString QFileSystemModel::filePath ( const QModelIndex & index ) const返回给定索引下模型中存储的项的路径。
我不知道这是否能回答你的问题,否则你可以给我们一些关于你尝试/想要达到的代码。
On qt website: http://doc.qt.io/qt-5/qfilesystemmodel.html
QString QFileSystemModel::filePath ( const QModelIndex & index ) const Returns the path of the item stored in the model under the index given.
I dont know if this answers your question, else you can give us some code about what you tried / are trying to reach.
更多推荐
发布评论