【发布时间】:2015-03-13 00:09:43
【问题描述】:
我的程序中有一个 QTreeView,用于在 Windows 操作系统上选择目录。它有效,但是,一些用户抱怨为了选择我的文档,他们必须展开 C:\Users\
编辑:Windows 资源管理器还包含其他项目,我想包括:网络和收藏夹。
【问题讨论】:
标签: qt qtreeview qfilesystemmodel
我的程序中有一个 QTreeView,用于在 Windows 操作系统上选择目录。它有效,但是,一些用户抱怨为了选择我的文档,他们必须展开 C:\Users\
编辑:Windows 资源管理器还包含其他项目,我想包括:网络和收藏夹。
【问题讨论】:
标签: qt qtreeview qfilesystemmodel
你需要使用qstandardpaths
此枚举描述了可以使用 QStandardPaths::writableLocation、QStandardPaths::standardLocations 和 QStandardPaths::displayName 等方法查询的不同位置。
QStandardPaths::MusicLocation 4 Returns the directory containing the user's music or other audio files. This is a generic value. If no directory specific for music files exists, a sensible fallback for storing user documents is returned.
QStandardPaths::MoviesLocation 5 Returns the directory containing the user's movies and videos. This is a generic value. If no directory specific for movie files exists, a sensible fallback for storing user documents is returned.
【讨论】: