Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QStandardPaths Class Reference

\inmodule QtCore More...

#include <qstandardpaths.h>

Collaboration diagram for QStandardPaths:

Public Types

enum  StandardLocation {
  DesktopLocation , DocumentsLocation , FontsLocation , ApplicationsLocation ,
  MusicLocation , MoviesLocation , PicturesLocation , TempLocation ,
  HomeLocation , AppLocalDataLocation , CacheLocation , GenericDataLocation ,
  RuntimeLocation , ConfigLocation , DownloadLocation , GenericCacheLocation ,
  GenericConfigLocation , AppDataLocation , AppConfigLocation , PublicShareLocation ,
  TemplatesLocation , StateLocation , GenericStateLocation
}
 This enum describes the different locations that can be queried using methods such as QStandardPaths::writableLocation, QStandardPaths::standardLocations, and QStandardPaths::displayName. More...
enum  LocateOption { LocateFile = 0x0 , LocateDirectory = 0x1 }
 This enum describes the different flags that can be used for controlling the behavior of QStandardPaths::locate and QStandardPaths::locateAll. More...

Static Public Member Functions

static QString writableLocation (StandardLocation type)
static QStringList standardLocations (StandardLocation type)
static QString locate (StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
static QStringList locateAll (StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
static QString displayName (StandardLocation type)
static QString findExecutable (const QString &executableName, const QStringList &paths=QStringList())
static void setTestModeEnabled (bool testMode)
static bool isTestModeEnabled ()

Detailed Description

\inmodule QtCore

The QStandardPaths class provides methods for accessing standard paths.

Since
5.0

This class contains functions to query standard locations on the local filesystem, for common tasks such as user-specific directories or system-wide configuration directories.

Definition at line 16 of file qstandardpaths.h.

Member Enumeration Documentation

◆ LocateOption

This enum describes the different flags that can be used for controlling the behavior of QStandardPaths::locate and QStandardPaths::locateAll.

\value LocateFile return only files \value LocateDirectory return only directories

Enumerator
LocateFile 
LocateDirectory 

Definition at line 51 of file qstandardpaths.h.

◆ StandardLocation

This enum describes the different locations that can be queried using methods such as QStandardPaths::writableLocation, QStandardPaths::standardLocations, and QStandardPaths::displayName.

QStandardPaths describes each location along two independent axes: app scope (private to the calling application or shared between applications) and user scope (rooted in the calling user's directories or system-wide). Each enum value below indicates its app scope; the platform tables further down show its user scope.

Data interchange with other users is out of the scope of QStandardPaths.

Enumerator
DesktopLocation 
DocumentsLocation 
FontsLocation 
ApplicationsLocation 
MusicLocation 
MoviesLocation 
PicturesLocation 
TempLocation 
HomeLocation 
AppLocalDataLocation 
CacheLocation 
GenericDataLocation 
RuntimeLocation 
ConfigLocation 
DownloadLocation 
GenericCacheLocation 
GenericConfigLocation 
AppDataLocation 
AppConfigLocation 
PublicShareLocation 
TemplatesLocation 
StateLocation 
GenericStateLocation 

Definition at line 21 of file qstandardpaths.h.

Member Function Documentation

◆ displayName()

QString QStandardPaths::displayName ( StandardLocation type)
static

displayName

Definition at line 608 of file qstandardpaths.cpp.

◆ findExecutable()

QString QStandardPaths::findExecutable ( const QString & executableName,
const QStringList & paths = QStringList() )
static

findExecutable

Definition at line 560 of file qstandardpaths.cpp.

◆ isTestModeEnabled()

bool QStandardPaths::isTestModeEnabled ( )
static

Returns true if test mode is enabled in QStandardPaths; otherwise returns false.

Definition at line 683 of file qstandardpaths.cpp.

◆ locate()

QString QStandardPaths::locate ( StandardLocation type,
const QString & fileName,
LocateOptions options = LocateFile )
static

locate

Definition at line 453 of file qstandardpaths.cpp.

◆ locateAll()

QStringList QStandardPaths::locateAll ( StandardLocation type,
const QString & fileName,
LocateOptions options = LocateFile )
static

locateAll

Definition at line 467 of file qstandardpaths.cpp.

◆ setTestModeEnabled()

void QStandardPaths::setTestModeEnabled ( bool testMode)
static

setTestModeEnabled

Definition at line 670 of file qstandardpaths.cpp.

◆ standardLocations()

QStringList QStandardPaths::standardLocations ( StandardLocation type)
static

standardLocations

See also
writableLocation()

Definition at line 228 of file qstandardpaths_android.cpp.

◆ writableLocation()

QString QStandardPaths::writableLocation ( StandardLocation type)
static

writableLocation

Definition at line 181 of file qstandardpaths_android.cpp.


The documentation for this class was generated from the following files: