Chinaunix首页 | 论坛 | 博客
  • 博客访问: 371987
  • 博文数量: 50
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 641
  • 用 户 组: 普通用户
  • 注册时间: 2014-05-09 22:35
个人简介

不怕你失败,就怕你爬不起来。

文章分类

全部博文(50)

文章存档

2014年(50)

我的朋友

分类: C/C++

2014-09-05 16:56:50

Qt提供QStandardPaths:standardLocations(type)方法来获取系统的标准路径(列表),其中type 的取值如下:


Constant Value Description
QStandardPaths::DesktopLocation 0 Returns the user's desktop directory. This is a generic value. On systems with no concept of a desktop, this is the same as QStandardPaths::HomeLocation.
QStandardPaths::DocumentsLocation 1 Returns the directory containing user document files. This is a generic value. The returned path is never empty.
QStandardPaths::FontsLocation 2 Returns the directory containing user's fonts. This is a generic value. Note that installing fonts may require additional, platform-specific operations.
QStandardPaths::ApplicationsLocation 3 Returns the directory containing the user applications (either executables, application bundles, or shortcuts to them). This is a generic value. Note that installing applications may require additional, platform-specific operations. Files, folders or shortcuts in this directory are platform-specific.
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.
QStandardPaths::PicturesLocation 6 Returns the directory containing the user's pictures or photos. This is a generic value. If no directory specific for picture files exists, a sensible fallback for storing user documents is returned.
QStandardPaths::TempLocation 7 Returns a directory where temporary files can be stored. The returned value might be application-specific, shared among other applications for this user, or even system-wide. The returned path is never empty.
QStandardPaths::HomeLocation 8 Returns the user's home directory (the same as ()). On Unix systems, this is equal to the HOME environment variable. This value might be generic or application-specific, but the returned path is never empty.
QStandardPaths::DataLocation 9 Returns a directory location where persistent application data can be stored. This is an application-specific directory. To obtain a path to store data to be shared with other applications, use QStandardPaths::GenericDataLocation. The returned path is never empty.
QStandardPaths::CacheLocation 10 Returns a directory location where user-specific non-essential (cached) data should be written. This is an application-specific directory. The returned path is never empty.
QStandardPaths::GenericCacheLocation 15 Returns a directory location where user-specific non-essential (cached) data, shared across applications, should be written. This is a generic value. Note that the returned path may be empty if the system has no concept of shared cache.
QStandardPaths::GenericDataLocation 11 Returns a directory location where persistent data shared across applications can be stored. This is a generic value. The returned path is never empty.
QStandardPaths::RuntimeLocation 12 Returns a directory location where runtime communication files should be written, like Unix local sockets. This is a generic value. The returned path may be empty on some systems.
QStandardPaths::ConfigLocation 13 Returns a directory location where user-specific configuration files should be written. This may be either a generic value or application-specific, and the returned path is never empty.
QStandardPaths::DownloadLocation 14 Returns a directory for user's downloaded files. This is a generic value. If no directory specific for downloads exists, a sensible fallback for storing user documents is returned.
QStandardPaths::GenericConfigLocation 16 Returns a directory location where user-specific configuration files shared between multiple applications should be written. This is a generic value and the returned path is never empty.


详情参见:

阅读(2500) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~