#ifdef Q_WS_MAC
#include "CoreFoundation/CoreFoundation.h"
#endif
#ifdef Q_WS_MAC
CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef,kCFURLPOSIXPathStyle);
const char *pathPtr = CFStringGetCStringPtr(macPath,CFStringGetSystemEncoding());
CFRelease(pluginRef);
CFRelease(macPath);
QString dirPath
= filePath.
left(filePath.
lastIndexOf("/"));
return dirPath;
#else
return qApp->applicationDirPath() + "/";
#endif
#ifdef Q_WS_MAC
#include "CoreFoundation/CoreFoundation.h"
#endif
#ifdef Q_WS_MAC
CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef,kCFURLPOSIXPathStyle);
const char *pathPtr = CFStringGetCStringPtr(macPath,CFStringGetSystemEncoding());
CFRelease(pluginRef);
CFRelease(macPath);
QString filePath = QString(pathPtr);
QString dirPath = filePath.left(filePath.lastIndexOf("/"));
return dirPath;
#else
return qApp->applicationDirPath() + "/";
#endif
To copy to clipboard, switch view to plain text mode
Bookmarks