Qt 4.8
Functions
qcoreapplication_mac.cpp File Reference
#include "qcoreapplication.h"
#include "private/qcoreapplication_p.h"
#include <private/qcore_mac_p.h>

Go to the source code of this file.

Functions

QString qAppFileName ()
 

Function Documentation

◆ qAppFileName()

QString qAppFileName ( )

Definition at line 51 of file qcoreapplication_mac.cpp.

52 {
53  static QString appFileName;
54  if (appFileName.isEmpty()) {
55  QCFType<CFURLRef> bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
56  if(bundleURL) {
57  QCFString cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle));
58  if(cfPath)
59  appFileName = cfPath;
60  }
61  }
62  return appFileName;
63 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704