以下成員源於類 QDir are part of the Qt compatibility layer. We advise against using them in new code.
| QString | absFilePath (const QString & fileName , bool acceptAbsPath = true) const |
| QString | absPath () const |
| void | convertToAbs () |
| QFileInfoList | entryInfoList (const QString & nameFilter , Filters filters = NoFilter, SortFlags sort = NoSort) const |
| QStringList | entryList (const QString & nameFilter , Filters filters = NoFilter, SortFlags sort = NoSort) const |
| bool | matchAllDirs () const |
| bool | mkdir (const QString & dirName , bool acceptAbsPath ) const |
| QString | nameFilter () const |
| bool | rmdir (const QString & dirName , bool acceptAbsPath ) const |
| void | setMatchAllDirs (bool on ) |
| void | setNameFilter (const QString & nameFilter ) |
| QString | cleanDirPath (const QString & name ) |
| QString | currentDirPath () |
| QString | homeDirPath () |
| QString | rootDirPath () |
使用 absoluteFilePath ( fileName ) 代替。
The acceptAbsPath 參數被忽略。
使用 absolutePath () 代替。
[static]
QString
QDir::
cleanDirPath
(const
QString
&
name
)
使用 cleanPath () 代替。
使用 makeAbsolute () 代替。
[static]
QString
QDir::
currentDirPath
()
Returns the absolute path of the application's current directory.
使用 currentPath () 代替。
另請參閱 currentPath () 和 setCurrent ().
這是重載函數。
Use the overload that takes a name filter string list as first argument instead of a combination of attribute filter flags.
這是重載函數。
Use the overload that takes a name filter string list as first argument instead of a combination of attribute filter flags.
[static]
QString
QDir::
homeDirPath
()
Returns the absolute path of the user's home directory.
使用 homePath () 代替。
另請參閱 homePath ().
另請參閱 setMatchAllDirs ().
Use mkdir( dirName ) 代替。
The acceptAbsPath 參數被忽略。
使用 nameFilters () 代替。
另請參閱 setNameFilter ().
Use rmdir( dirName ) 代替。
The acceptAbsPath 參數被忽略。
[static]
QString
QDir::
rootDirPath
()
Returns the absolute path of the root directory.
使用 rootPath () 代替。
另請參閱 rootPath ().
使用 setFilter () 代替。
另請參閱 matchAllDirs ().
使用 setNameFilters () 代替。
The nameFilter is a wildcard (globbing) filter that understands "*" and "?" wildcards. (See QRegExp wildcard matching .) You may specify several filter entries, each separated by spaces or by semicolons.
For example, if you want entryList () 和 entryInfoList () to list all files ending with either ".cpp" or ".h", you would use either dir. setNameFilters ("*.cpp *.h") or dir. setNameFilters ("*.cpp;*.h").
例如,若有代碼像
QString filter = "*.cpp *.cxx *.cc"; dir.setNameFilter(filter);
可以把它重寫成
QString filter = "*.cpp *.cxx *.cc"; dir.setNameFilters(filter.split(' '));
另請參閱 nameFilter ().