diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-02-11 16:31:10 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-02-14 12:43:01 +0100 |
commit | bace97aa5ba382191ccc616b33bbb11fe2b72f2b (patch) | |
tree | d258ee507e04562259d8ee61b912060d2bb034ed /src/corelib/kernel/qobject.cpp | |
parent | a2206b74aedb14f8938ccad2c26d0c22cfe91963 (diff) |
Improve error message when mixing incompatible Qt library versions
The implementation of the check has been moved to a single helper
function. The reason for doing this check in QWidgetPrivate as well,
when it's already done in QObjectPrivate, is to catch incompatible
libraries where QtWidgets is the odd one out, e.g.:
QtSomeModule 5.15.0 -> QtWidget 5.15.1 -> QtCore 5.15.0
Technically any non-final subclass of QObjectPrivate should have
this check.
Change-Id: Ia74064ad27de7335040a6d6b37d11574f818c878
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a51b794604..a8e2c43934 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -184,15 +184,7 @@ QMetaObject *QObjectData::dynamicMetaObject() const QObjectPrivate::QObjectPrivate(int version) : threadData(nullptr), currentChildBeingDeleted(nullptr) { -#ifdef QT_BUILD_INTERNAL - // Don't check the version parameter in internal builds. - // This allows incompatible versions to be loaded, possibly for testing. - Q_UNUSED(version); -#else - if (Q_UNLIKELY(version != QObjectPrivateVersion)) - qFatal("Cannot mix incompatible Qt library (version 0x%x) with this library (version 0x%x)", - version, QObjectPrivateVersion); -#endif + checkForIncompatibleLibraryVersion(version); // QObjectData initialization q_ptr = nullptr; |