iveswang
2024-06-12 7610c3a509b8a04d25e72a6282d9c8ea8ecbd27f
fix: QObjectPrivate::threadData type change when qt >=5.15
1个文件已修改
9 ■■■■■ 已修改文件
src/core/qwkglobal.cpp 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
    }
}