如何通过QFileSystemModel获取所选文件的* full *文件路径?(How to get the *full* filepath of a selected file via QFile

编程入门 行业动态 更新时间:2024-10-25 14:29:55
如何通过QFileSystemModel获取所选文件的* full *文件路径?(How to get the *full* filepath of a selected file via QFileSystemModel?)

如何通过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.

更多推荐

本文发布于:2023-07-24 10:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1244941.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   所选   路径   QFileSystemModel   full

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!