summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcfsocketnotifier.cpp14
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp10
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp6
-rw-r--r--src/corelib/kernel/qproperty.cpp25
-rw-r--r--src/corelib/kernel/qsharedmemory_p.h10
-rw-r--r--src/corelib/kernel/qsharedmemory_systemv.cpp2
6 files changed, 59 insertions, 8 deletions
diff --git a/src/corelib/kernel/qcfsocketnotifier.cpp b/src/corelib/kernel/qcfsocketnotifier.cpp
index 920ec9cd86..13fe30d0cd 100644
--- a/src/corelib/kernel/qcfsocketnotifier.cpp
+++ b/src/corelib/kernel/qcfsocketnotifier.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
Socket Notifiers
*************************************************************************/
void qt_mac_socket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef,
- const void *, void *info)
+ const void *data, void *info)
{
QCFSocketNotifier *cfSocketNotifier = static_cast<QCFSocketNotifier *>(info);
@@ -61,7 +61,15 @@ void qt_mac_socket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CF
// notification after we've successfully disabled the CFSocket, but our Qt
// notifier is now gone. The upshot is we have to check the notifier
// every time.
- if (callbackType == kCFSocketReadCallBack) {
+ if (callbackType == kCFSocketConnectCallBack) {
+ // The data pointer will be non-null on connection error
+ if (data) {
+ if (socketInfo->readNotifier)
+ QCoreApplication::sendEvent(socketInfo->readNotifier, &notifierEvent);
+ if (socketInfo->writeNotifier)
+ QCoreApplication::sendEvent(socketInfo->writeNotifier, &notifierEvent);
+ }
+ } else if (callbackType == kCFSocketReadCallBack) {
if (socketInfo->readNotifier && socketInfo->readEnabled) {
socketInfo->readEnabled = false;
QCoreApplication::sendEvent(socketInfo->readNotifier, &notifierEvent);
@@ -152,7 +160,7 @@ void QCFSocketNotifier::registerSocketNotifier(QSocketNotifier *notifier)
// Create CFSocket, specify that we want both read and write callbacks (the callbacks
// are enabled/disabled later on).
- const int callbackTypes = kCFSocketReadCallBack | kCFSocketWriteCallBack;
+ const int callbackTypes = kCFSocketConnectCallBack | kCFSocketReadCallBack | kCFSocketWriteCallBack;
CFSocketContext context = {0, this, 0, 0, 0};
socketInfo->socket = CFSocketCreateWithNative(kCFAllocatorDefault, nativeSocket, callbackTypes, qt_mac_socket_callback, &context);
if (CFSocketIsValid(socketInfo->socket) == false) {
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 67cc56449a..9c1f2afcb1 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -252,6 +252,7 @@ Q_GLOBAL_STATIC(QStartUpFuncList, preRList)
typedef QList<QtCleanUpFunction> QVFuncList;
Q_GLOBAL_STATIC(QVFuncList, postRList)
static QBasicMutex globalRoutinesMutex;
+static bool preRoutinesCalled = false;
/*!
\internal
@@ -265,8 +266,10 @@ void qAddPreRoutine(QtStartUpFunction p)
if (!list)
return;
- if (QCoreApplication::instance())
+ if (preRoutinesCalled) {
+ Q_ASSERT(QCoreApplication::instance());
p();
+ }
// Due to C++11 parallel dynamic initialization, this can be called
// from multiple threads.
@@ -294,6 +297,9 @@ void qRemovePostRoutine(QtCleanUpFunction p)
static void qt_call_pre_routines()
{
+ // After will be allowed invoke QtStartUpFunction when calling qAddPreRoutine
+ preRoutinesCalled = true;
+
if (!preRList.exists())
return;
@@ -855,6 +861,8 @@ void QCoreApplicationPrivate::init()
*/
QCoreApplication::~QCoreApplication()
{
+ preRoutinesCalled = false;
+
qt_call_post_routines();
self = nullptr;
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index d547642e7d..28d11d0576 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -492,13 +492,17 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
{
Q_D(QEventDispatcherWin32);
- d->interrupt.storeRelaxed(false);
+ // We don't know _when_ the interrupt occurred so we have to honor it.
+ const bool wasInterrupted = d->interrupt.fetchAndStoreRelaxed(false);
emit awake();
// To prevent livelocks, send posted events once per iteration.
// QCoreApplication::sendPostedEvents() takes care about recursions.
sendPostedEvents();
+ if (wasInterrupted)
+ return false;
+
auto threadData = d->threadData.loadRelaxed();
bool canWait;
bool retVal = false;
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp
index 31c766b128..e6fb25c6b5 100644
--- a/src/corelib/kernel/qproperty.cpp
+++ b/src/corelib/kernel/qproperty.cpp
@@ -948,6 +948,29 @@ QString QPropertyBindingError::description() const
*/
/*!
+ \macro Q_OBJECT_BINDABLE_PROPERTY(containingClass, type, name, signal)
+ \since 6.0
+ \relates QObjectBindableProperty
+ \brief Declares a \l QObjectBindableProperty inside \a containingClass
+ of type \a type with name \a name. If the optional argument \a signal is given,
+ this signal will be emitted when the property is marked dirty.
+
+ \sa {Qt's Property System}, {Qt Bindable Properties}
+*/
+
+/*!
+ \macro Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(containingClass, type, name, initialvalue, signal)
+ \since 6.0
+ \relates QObjectBindableProperty
+ \brief Declares a \l QObjectBindableProperty inside \a containingClass
+ of type \a type with name \a name which is initialized to \a initialvalue.
+ If the optional argument \a signal is given, this signal will be emitted when
+ the property is marked dirty.
+
+ \sa {Qt's Property System}, {Qt Bindable Properties}
+*/
+
+/*!
\fn template <typename Class, typename T, auto offset, auto Callback> QObjectBindableProperty<Class, T, offset, Callback>::QObjectBindableProperty()
Constructs a property with a default constructed instance of T.
@@ -1126,6 +1149,8 @@ QString QPropertyBindingError::description() const
/*!
\class QPropertyAlias
\inmodule QtCore
+ \internal
+
\brief The QPropertyAlias class is a safe alias for a QProperty with same template parameter.
\ingroup tools
diff --git a/src/corelib/kernel/qsharedmemory_p.h b/src/corelib/kernel/qsharedmemory_p.h
index a248937037..e06e7e86f3 100644
--- a/src/corelib/kernel/qsharedmemory_p.h
+++ b/src/corelib/kernel/qsharedmemory_p.h
@@ -56,14 +56,20 @@
#include <QtCore/qstring.h>
#ifdef QT_NO_SHAREDMEMORY
-# ifndef QT_NO_SYSTEMSEMAPHORE
+# ifndef QT_NO_SYSTEMSEMAPHORE
+
+QT_BEGIN_NAMESPACE
+
namespace QSharedMemoryPrivate
{
int createUnixKeyFile(const QString &fileName);
QString makePlatformSafeKey(const QString &key,
const QString &prefix = QLatin1String("qipc_sharedmemory_"));
}
-#endif
+
+QT_END_NAMESPACE
+
+# endif
#else
#include "qsystemsemaphore.h"
diff --git a/src/corelib/kernel/qsharedmemory_systemv.cpp b/src/corelib/kernel/qsharedmemory_systemv.cpp
index 8149f20724..65ad23b9f6 100644
--- a/src/corelib/kernel/qsharedmemory_systemv.cpp
+++ b/src/corelib/kernel/qsharedmemory_systemv.cpp
@@ -109,7 +109,7 @@ key_t QSharedMemoryPrivate::handle()
0 already existed
1 created
*/
-int QSharedMemoryPrivate::createUnixKeyFile(const QString &fileName)
+int QT_PREPEND_NAMESPACE(QSharedMemoryPrivate)::createUnixKeyFile(const QString &fileName)
{
int fd = qt_safe_open(QFile::encodeName(fileName).constData(),
O_EXCL | O_CREAT | O_RDWR, 0640);