6#ifndef QT_NO_STANDARDPATHS
10#include <private/qcore_mac_p.h>
12#ifndef QT_BOOTSTRAPPED
16#import <Foundation/Foundation.h>
23 NSSearchPathDomainMask
mask)
25 return QString::fromNSString(
26 [NSSearchPathForDirectoriesInDomains(
directory,
mask, YES) lastObject]);
33 return NSDesktopDirectory;
35 return NSDocumentDirectory;
37 return NSApplicationDirectory;
39 return NSMusicDirectory;
41 return NSMoviesDirectory;
43 return NSPicturesDirectory;
48 return NSApplicationSupportDirectory;
51 return NSCachesDirectory;
53 return NSDownloadsDirectory;
55 return NSSharedPublicDirectory;
58 return (NSSearchPathDirectory)0;
64#ifndef QT_BOOTSTRAPPED
70 path += u
'/' + appName;
77 NSSearchPathDomainMask
mask = NSUserDomainMask,
78 bool appendOrgAndApp =
false)
89#if defined(QT_PLATFORM_UIKIT)
124 if (appendOrgAndApp) {
break; }
134 if (appendOrgAndApp) {
168#if defined(QT_PLATFORM_UIKIT)
176 QList<NSSearchPathDomainMask> masks;
177 masks << NSLocalDomainMask;
179 masks << NSSystemDomainMask;
184 if (!
path.isEmpty() && !dirs.contains(
path))
190 CFBundleRef mainBundle = CFBundleGetMainBundle();
192 if (QCFType<CFURLRef> resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle)) {
193 if (QCFType<CFURLRef> absoluteResouresURL = CFURLCopyAbsoluteURL(resourcesURL)) {
194 if (QCFType<CFStringRef>
path = CFURLCopyFileSystemPath(absoluteResouresURL,
195 kCFURLPOSIXPathStyle)) {
196 dirs.append(QString::fromCFString(
path));
204 if (!localDir.isEmpty())
205 dirs.prepend(localDir);
209#ifndef QT_BOOTSTRAPPED
229 if (QCFType<CFURLRef>
url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
230 fsPath, kCFURLPOSIXPathStyle,
true)) {
232 CFURLCopyResourcePropertyForKey(
url, kCFURLLocalizedNameKey, &
name, NULL);
233 if (
name && CFStringGetLength(
name))
234 return QString::fromCFString(
name);
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
QString organizationName
the name of the organization that wrote this application
QString applicationName
the name of this application
static QString tempPath()
Returns the absolute canonical path of the system's temporary directory.
static QString homePath()
Returns the absolute path of the user's home directory.
static bool isTestModeEnabled()
static QStringList standardLocations(StandardLocation type)
static QString writableLocation(StandardLocation type)
static QString displayName(StandardLocation type)
StandardLocation
This enum describes the different locations that can be queried using methods such as QStandardPaths:...
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLsizei const GLchar *const * path
static QString baseWritableLocation(QStandardPaths::StandardLocation type, NSSearchPathDomainMask mask=NSUserDomainMask, bool appendOrgAndApp=false)
static NSSearchPathDirectory searchPathDirectory(QStandardPaths::StandardLocation type)
static void appendOrganizationAndApp(QString &path)
static QString pathForDirectory(NSSearchPathDirectory directory, NSSearchPathDomainMask mask)
QUrl url("example.com")
[constructor-url-reference]