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
qcoreapplication_mac.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6#include "private/qcoreapplication_p.h"
7#include <private/qcore_mac_p.h>
8
10
11/*****************************************************************************
12 QCoreApplication utility functions
13 *****************************************************************************/
14QString qAppFileName()
15{
16 // QCoreApplication::applicationFilePath() expects a canonical path
17 static QString appFileName;
18 if (appFileName.isEmpty()) {
19 QCFType<CFURLRef> bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
20 if (bundleURL) {
21 QCFString cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle));
22 if (cfPath)
23 appFileName = cfPath;
24 }
25 }
26 return appFileName;
27}
28
29QT_END_NAMESPACE
Combined button and popup list for selecting options.