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
5
#
include
"qcoreapplication.h"
6
#
include
"private/qcoreapplication_p.h"
7
#
include
<
private
/
qcore_mac_p
.
h
>
8
9
#
include
<
qfileinfo
.
h
>
10
11
QT_BEGIN_NAMESPACE
12
13
/*****************************************************************************
14
QCoreApplication utility functions
15
*****************************************************************************/
16
QString qAppFileName()
17
{
18
// QCoreApplication::applicationFilePath() expects a canonical path
19
QString appFileName;
20
QCFType<CFURLRef> bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
21
if
(bundleURL) {
22
QCFString cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle));
23
if
(cfPath)
24
appFileName = QFileInfo(cfPath).canonicalFilePath();
25
}
26
return
appFileName;
27
}
28
29
QT_END_NAMESPACE
qtbase
src
corelib
kernel
qcoreapplication_mac.cpp
Generated on
for Qt by
1.16.1