summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-06-26 16:20:21 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-06-27 13:54:35 +0200
commit4dd8a63fc13cee365c58ef67fa4a4503aeceebe8 (patch)
treec34de00e0bceeb70ed006e06a7fefc21537c72a1 /src/corelib/kernel
parent5757b8c516ad0d613739b222687583bca914a981 (diff)
parentfae33bfbe35f8d082b420ee09662ff60634cb355 (diff)
Merge remote-tracking branch 'origin/5.5.0' into 5.5
Conflicts: src/plugins/platforms/cocoa/qcocoafiledialoghelper.h Manually fixed src/testlib/qtestcase.cpp to return the right type. Change-Id: Id1634dbe3d73fefe9431b9f5378846cb187624e4
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp11
-rw-r--r--src/corelib/kernel/qmetatype.cpp20
2 files changed, 26 insertions, 5 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 34dad73c80..8489afe5a7 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1005,6 +1005,17 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
do not change the focus widget.
\endlist
+ \b{Future direction:} This function will not be called for objects that live
+ outside the main thread in Qt 6. Applications that need that functionality
+ should find other solutions for their event inspection needs in the meantime.
+ The change may be extended to the main thread, causing this function to be
+ deprecated.
+
+ \warning If you override this function, you must ensure all threads that
+ process events stop doing so before your application object begins
+ destruction. This includes threads started by other libraries that you may be
+ using, but does not apply to Qt's own threads.
+
\sa QObject::event(), installNativeEventFilter()
*/
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 3b70ef92ed..58912e3fb7 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -303,7 +303,7 @@ struct DefinedTypesFilter {
\omitvalue WeakPointerToQObject
\omitvalue TrackingPointerToQObject
\omitvalue WasDeclaredAsMetaType
- \value IsGadget This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5.
+ \omitvalue IsGadget This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5.
*/
/*!
@@ -1046,6 +1046,16 @@ int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName,
if (idx >= User) {
previousSize = ct->at(idx - User).size;
previousFlags = ct->at(idx - User).flags;
+
+ // Set new/additional flags in case of old library/app.
+ // Ensures that older code works in conjunction with new Qt releases
+ // requiring the new flags.
+ if (flags != previousFlags) {
+ QCustomTypeInfo &inf = ct->data()[idx - User];
+ inf.flags |= flags;
+ if (metaObject)
+ inf.metaObject = metaObject;
+ }
}
}
@@ -1061,11 +1071,11 @@ int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName,
normalizedTypeName.constData(), idx, previousSize, size);
}
+ // Do not compare types higher than 0x100:
// Ignore WasDeclaredAsMetaType inconsitency, to many users were hitting the problem
- previousFlags |= WasDeclaredAsMetaType;
- flags |= WasDeclaredAsMetaType;
-
- if (previousFlags != flags) {
+ // Ignore IsGadget as it was added in Qt 5.5
+ // Ignore all the future flags as well
+ if ((previousFlags ^ flags) & 0xff) {
const int maskForTypeInfo = NeedsConstruction | NeedsDestruction | MovableType;
const char *msg = "QMetaType::registerType: Binary compatibility break. "
"\nType flags for type '%s' [%i] don't match. Previously "