From 9286c8b9c23a613f96636b8e2d1391d89cedd199 Mon Sep 17 00:00:00 2001 From: Zhao Yuhang <2546789017@qq.com> Date: 周六, 07 12月 2024 21:11:05 +0800 Subject: [PATCH] Win32 code cleanup & improve --- src/core/qwkglobal.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/qwkglobal.cpp b/src/core/qwkglobal.cpp index aa34606..ee33221 100644 --- a/src/core/qwkglobal.cpp +++ b/src/core/qwkglobal.cpp @@ -27,10 +27,14 @@ if (!obj) continue; +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) if (QObjectPrivate::get(obj)->threadData.loadRelaxed() != d->threadData.loadRelaxed()) { - qWarning( - "QCoreApplication: Object event filter cannot be in a different thread."); +#else + if (QObjectPrivate::get(obj)->threadData != d->threadData) { +#endif + qWarning("QCoreApplication: Object event filter cannot be in a different " + "thread."); continue; } if (obj->eventFilter(receiver, event)) @@ -39,5 +43,4 @@ } return false; } - } -- Gitblit v1.9.1