StandardPaths QML Type

標準システム・パスへのアクセスを提供する。詳細...

Import Statement: import QtCore
Since: Qt 6.2
Inherits:

QtObject

メソッド

詳細説明

StandardPaths シングルトン型は、標準システムパスを問い合わせるためのメソッドを提供する。

property url documentsFolder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)

QStandardPathsも参照してください

メソッドのドキュメント

string displayName(StandardLocation type)

指定された場所のローカライズされた表示名type を返すか、関連する場所が見つからない場合は空のQString を返します。

QStandardPaths::displayName()も参照


url findExecutable(string executableName, list<string> paths)

executableName という名前の実行可能ファイルを、指定されたpaths 内、またはpaths が空の場合はシステム・パスから検索します。

ほとんどのオペレーティング・システムでは、システム・パスはPATH 環境変数によって決定される。実行可能ファイルを検索するディレクトリは、paths 引数で設定できます。自分のパスとシステムパスの両方を検索するには、findExecutableを2回呼び、1回はpathsを設定し、もう1回はpathsを空にします。シンボリックリンクは、呼び出される名前によって動作が変わる実行可能ファイルの場合の動作を保持するために、解決されません。

注意: Windowsでは、通常の実行可能ファイルの拡張子(PATHEXT環境変数による)が自動的に付加される。例えば、findExecutable("foo")呼び出しは、存在すればfoo.exe またはfoo.bat を見つける。

実行可能ファイルへの絶対パスを返すか、見つからない場合は空文字列を返す。

与えられたexecutableName が実行可能ファイルを指す絶対パスの場合、そのクリーンパスが返されます。

QStandardPaths::findExecutable()も参照


url locate(StandardLocation type, string fileName, LocateOptions options)

type の標準の場所にあるfileName というファイルまたはディレクトリを検索します。

options フラグを使用すると、ファイルまたはディレクトリのどちらを検索するかを指定できます。デフォルトでは、このフラグはLocateFile に設定されています。

最初に見つかったファイルまたはディレクトリへの絶対パスを返し、そうでない場合は空文字列を返します。

QStandardPaths::locate()も参照


list<url> locateAll(StandardLocation type, string fileName, LocateOptions options)

type の標準の場所にある、fileName という名前のすべてのファイルまたはディレク トリを検索します。

options フラグを使用すると、ファイルまたはディレクトリを検索するかどうかを指定できます。デフォルトでは、このフラグはLocateFile に設定されています。

見つかったすべてのファイルのリストを返します。

QStandardPaths::locateAll()も参照してください


list<url> standardLocations(StandardLocation type)

type のファイルが属するすべてのディレクトリを返します。

ディレクトリのリストは、優先順位の高いものから低いものへとソートされ、writableLocation() が判別可能な場合は、そこから始まります。型の場所が定義されていない場合、このリストは空である。

QStandardPaths::standardLocations()も参照のこと


url writableLocation(StandardLocation type)

type のファイルが書き込まれるべきディレクトリを返すか、場所が特定できない場合は空文字列を返す。

つまり、システムまたはユーザが作成する必要があります。

QStandardPaths::writableLocation()も参照


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.