#include <QtCore/QDir>

More information will be added here shortly. For now, you'll find more extensive information about this class in the Qt reference for QDir


Public Types Index

enum Filter

Dirs 0x001, Files 0x002, Drives 0x004, NoSymLinks 0x008, AllEntries Dirs | Files | Drives, TypeMask 0x00f, Readable 0x010, Writable 0x020, Executable 0x040, PermissionMask 0x070, Modified 0x080, Hidden 0x100, System 0x200, AccessMask 0x3F0, AllDirs 0x400, CaseSensitive 0x800, NoDotAndDotDot 0x1000, NoDot 0x2000, NoDotDot 0x4000, NoFilter -1

enum SortFlag

Name 0x00, Time 0x01, Size 0x02, Unsorted 0x03, SortByMask 0x03, DirsFirst 0x04, Reversed 0x08, IgnoreCase 0x10, DirsLast 0x20, LocaleAware 0x40, Type 0x80, NoSort -1

Protected Attributes Index

Public Functions Index

QDir (const QDir &)
QDir (const QString &path=QString())
QDir (const QString &path, const QString &nameFilter, SortFlags sort=SortFlags(Name|IgnoreCase), Filters filter=AllEntries)
~QDir ()
QStringabsoluteFilePath (const QString &fileName) const
QStringabsolutePath () const
QStringcanonicalPath () const
boolcd (const QString &dirName)
boolcdUp ()
uintcount () const
QStringdirName () const
QFileInfoListentryInfoList (Filters filters=NoFilter, SortFlags sort=NoSort) const
QFileInfoListentryInfoList (const QStringList &nameFilters, Filters filters=NoFilter, SortFlags sort=NoSort) const
QStringListentryList (Filters filters=NoFilter, SortFlags sort=NoSort) const
QStringListentryList (const QStringList &nameFilters, Filters filters=NoFilter, SortFlags sort=NoSort) const
boolexists () const
boolexists (const QString &name) const
QStringfilePath (const QString &fileName) const
Filtersfilter () const
boolisAbsolute () const
boolisReadable () const
boolisRelative () const
boolisRoot () const
boolmakeAbsolute ()
boolmkdir (const QString &dirName) const
boolmkpath (const QString &dirPath) const
QStringListnameFilters () const
booloperator!= (const QDir &dir) const
QDir &operator= (const QDir &)
QDir &operator= (const QString &path)
booloperator== (const QDir &dir) const
QStringoperator[] (int) const
QStringpath () const
voidrefresh () const
QStringrelativeFilePath (const QString &fileName) const
boolremove (const QString &fileName)
boolrename (const QString &oldName, const QString &newName)
boolrmdir (const QString &dirName) const
boolrmpath (const QString &dirPath) const
voidsetFilter (Filters filter)
voidsetNameFilters (const QStringList &nameFilters)
voidsetPath (const QString &path)
voidsetSorting (SortFlags sort)
SortFlagssorting () const

Static Public Functions Index

voidaddResourceSearchPath (const QString &path)
voidaddSearchPath (const QString &prefix, const QString &path)
QStringcleanPath (const QString &path)
QDircurrent ()
QStringcurrentPath ()
QFileInfoListdrives ()
QStringfromNativeSeparators (const QString &pathName)
QDirhome ()
QStringhomePath ()
boolisAbsolutePath (const QString &path)
boolisRelativePath (const QString &path)
boolmatch (const QStringList &filters, const QString &fileName)
boolmatch (const QString &filter, const QString &fileName)
QStringListnameFiltersFromString (const QString &nameFilter)
QDirroot ()
QStringrootPath ()
QStringListsearchPaths (const QString &prefix)
QCharseparator ()
boolsetCurrent (const QString &path)
voidsetSearchPaths (const QString &prefix, const QStringList &searchPaths)
QDirtemp ()
QStringtempPath ()
QStringtoNativeSeparators (const QString &pathName)

Public Types


Dirs 0x001
Files 0x002
Drives 0x004
AllEntries Dirs | Files | Drives
TypeMask 0x00f
Readable 0x010
Writable 0x020
Executable 0x040
PermissionMask 0x070
Modified 0x080
Hidden 0x100
System 0x200
AccessMask 0x3F0
AllDirs 0x400
CaseSensitive 0x800
NoDotAndDotDot 0x1000
NoDot 0x2000
NoDotDot 0x4000
NoFilter -1


Name 0x00
Time 0x01
Size 0x02
Unsorted 0x03
SortByMask 0x03
DirsFirst 0x04
Reversed 0x08
IgnoreCase 0x10
DirsLast 0x20
LocaleAware 0x40
Type 0x80
NoSort -1

Protected Attributes

QSharedDataPointer< QDirPrivate > d_ptr ()

Public Functions

QDir (

QDir (

QDir (
  • const QString &path,
  • const QString &nameFilter,
  • SortFlagssort,
  • Filtersfilter )

~QDir ()


QString absoluteFilePath (

QString absolutePath ()

QString canonicalPath ()

bool cd (

bool cdUp ()

uint count ()

QString dirName ()

QFileInfoList entryInfoList (
  • Filtersfilters,
  • SortFlagssort )

QFileInfoList entryInfoList (
  • const QStringList &nameFilters,
  • Filtersfilters,
  • SortFlagssort )

QStringList entryList (
  • Filtersfilters,
  • SortFlagssort )

QStringList entryList (
  • const QStringList &nameFilters,
  • Filtersfilters,
  • SortFlagssort )

bool exists ()

bool exists (

QString filePath (

Filters filter ()

bool isAbsolute ()

bool isReadable ()

bool isRelative ()

bool isRoot ()

bool makeAbsolute ()

bool mkdir (

bool mkpath (

QStringList nameFilters ()

bool operator!= (

QDir & operator= (

QDir & operator= (

bool operator== (

QString operator[] (
  • int)

QString path ()

void refresh ()

QString relativeFilePath (

bool remove (

bool rename (

bool rmdir (

bool rmpath (

void setFilter (
  • Filtersfilter)

void setNameFilters (

void setPath (

void setSorting (
  • SortFlagssort)

SortFlags sorting ()

Static Public Functions

void addResourceSearchPath (

void addSearchPath (

QString cleanPath (

QDir current ()

QString currentPath ()

QFileInfoList drives ()

QString fromNativeSeparators (

QDir home ()

QString homePath ()

bool isAbsolutePath (

bool isRelativePath (

bool match (

bool match (

QStringList nameFiltersFromString (

QDir root ()

QString rootPath ()

QStringList searchPaths (

QChar separator ()

bool setCurrent (

void setSearchPaths (

QDir temp ()

QString tempPath ()

QString toNativeSeparators (

Last modified: 2015-07-24

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus