Provides access to the standard system paths. 更多...
| import 語句: |
import QtCore
|
| Since: | Qt 6.2 |
| 繼承: |
The StandardPaths singleton type provides methods for querying the standard system paths.
property url documentsFolder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
另請參閱 QStandardPaths .
|
string displayName ( StandardLocation type ) |
返迴本地化顯示名為給定位置 type 或空 QString 若找不到相關位置。
另請參閱 QStandardPaths::displayName ().
|
url findExecutable ( string executableName , list < string > paths ) |
Finds the executable named executableName 以指定 paths , or the system paths if paths is empty.
On most operating systems the system path is determined by the
PATH
environment variable. The directories where to search for the executable can be set in the paths argument. To search in both your own paths and the system paths, call findExecutable twice, once with paths set and once with paths empty. Symlinks are not resolved in order to preserve behavior for the case of executables whose behavior depends on the name they are invoked with.
注意:
On Windows, the usual executable extensions (from the PATHEXT environment variable) are automatically appended. For example, the findExecutable("foo") call finds
foo.exe
or
foo.bat
若存在。
Returns the absolute file path to the executable, or an empty string if not found.
若給定 executableName is an absolute path pointing to an executable, its clean path is returned.
另請參閱 QStandardPaths::findExecutable ().
|
url locate ( StandardLocation type , string fileName , LocateOptions options ) |
查找的文件 (或目錄) 稱為 fileName 在標準位置對於 type .
The
options
flag lets you specify whether to look for files or directories. By default, this flag is set to
LocateFile
.
Returns the absolute path to the first file or directory found, otherwise returns an empty string.
另請參閱 QStandardPaths::locate ().
|
list < url > locateAll ( StandardLocation type , string fileName , LocateOptions options ) |
Finds all files or directories by the name, fileName , in the standard locations for type .
The
options
flag lets you specify whether to look for files or directories. By default, this flag is set to
LocateFile
.
返迴找到的所有文件的列錶。
另請參閱 QStandardPaths::locateAll ().
Returns all the directories where files of type belong.
The list of directories is sorted from high to low priority, starting with writableLocation () if it can be determined. This list is empty if no locations for type are defined.
另請參閱 QStandardPaths::standardLocations ().
|
url writableLocation ( StandardLocation type ) |
Returns the directory where files of type should be written to, or an empty string if the location cannot be determined.
注意: The storage location returned may not exist; that is, it may need to be created by the system or the user.
另請參閱 QStandardPaths::writableLocation ().