summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/global/qlibraryinfo.cpp21
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/corelib/global/qnamespace.qdoc14
4 files changed, 37 insertions, 5 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index ea91dee471..c9e155555c 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -702,7 +702,7 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
64-bit integer literals in a platform-independent way. The
Q_CHECK_PTR() macro prints a warning containing the source code's
file name and line number, saying that the program ran out of
- memory, if the pointer is 0. The qPrintable() and qUtf8Printable()
+ memory, if the pointer is \nullptr. The qPrintable() and qUtf8Printable()
macros represent an easy way of printing text.
The QT_POINTER_SIZE macro expands to the size of a pointer in bytes.
@@ -3279,7 +3279,7 @@ QByteArray QSysInfo::bootUniqueId()
\macro void Q_CHECK_PTR(void *pointer)
\relates <QtGlobal>
- If \a pointer is 0, prints a message containing the source
+ If \a pointer is \nullptr, prints a message containing the source
code's file name and line number, saying that the program ran out
of memory and aborts program execution. It throws \c std::bad_alloc instead
if exceptions are enabled.
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index f8accab548..c8c7c0bf9b 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -534,8 +534,25 @@ static QString getRelocatablePrefix()
#if defined(QT_STATIC)
prefixPath = prefixFromAppDirHelper();
#elif defined(Q_OS_DARWIN) && QT_CONFIG(framework)
- CFBundleRef qtCoreBundle = CFBundleGetBundleWithIdentifier(
- CFSTR("org.qt-project.QtCore"));
+ auto qtCoreBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.qt-project.QtCore"));
+ if (!qtCoreBundle) {
+ // When running Qt apps over Samba shares, CoreFoundation will fail to find
+ // the Resources directory inside the bundle, This directory is a symlink,
+ // and CF relies on readdir() and dtent.dt_type to detect symlinks, which
+ // does not work reliably for Samba shares. We work around it by manually
+ // looking for the QtCore bundle.
+ auto allBundles = CFBundleGetAllBundles();
+ auto bundleCount = CFArrayGetCount(allBundles);
+ for (int i = 0; i < bundleCount; ++i) {
+ auto bundle = CFBundleRef(CFArrayGetValueAtIndex(allBundles, i));
+ auto url = QCFType<CFURLRef>(CFBundleCopyBundleURL(bundle));
+ auto path = QCFType<CFStringRef>(CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle));
+ if (CFStringHasSuffix(path, CFSTR("/QtCore.framework"))) {
+ qtCoreBundle = bundle;
+ break;
+ }
+ }
+ }
Q_ASSERT(qtCoreBundle);
QCFType<CFURLRef> qtCorePath = CFBundleCopyBundleURL(qtCoreBundle);
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index b9e981b4a6..f278850ccf 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1749,6 +1749,9 @@ namespace Qt {
PassThrough
};
+ // QTBUG-48701
+ enum ReturnByValue_t { ReturnByValue }; // ### Qt 7: Remove me
+
#ifndef Q_QDOC
// NOTE: Generally, do not add Q_ENUM_NS if a corresponding Q_FLAG_NS exists.
Q_ENUM_NS(ScrollBarPolicy)
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 6149281904..9acb978efc 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1023,7 +1023,7 @@
\value WA_MacNoClickThrough This value is obsolete and has no effect.
- \value WA_MacOpaqueSizeGrip Indicates that the native Carbon size grip
+ \value WA_MacOpaqueSizeGrip Indicates that the native size grip
should be opaque instead of transparent (the default). This attribute
is only applicable to \macos and is set by the widget's author.
@@ -3319,3 +3319,15 @@
\value RoundPreferFloor Round up for .75 and above.
\value PassThrough Don't round.
*/
+
+/*!
+ \enum Qt::ReturnByValue_t
+ \since 5.15
+
+ This is a dummy type, designed to help users transition from certain deprecated APIs to their replacement APIs.
+
+ \sa QCursor::bitmap()
+ \sa QCursor::mask()
+ \sa QLabel::picture()
+ \sa QLabel::pixmap()
+*/