From 29822d1a2be8d443e35829bc198c8c4a9aea5739 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 16 May 2024 00:16:03 +0200 Subject: [PATCH] ThreadUtils: Replace the implementation for Qt 6.8 Change-Id: I8d4890179165bca02af972debfe4f11fae41ebbd Reviewed-by: Eike Ziller --- src/libs/utils/threadutils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/utils/threadutils.cpp b/src/libs/utils/threadutils.cpp index 344779dc931..cfb18059a63 100644 --- a/src/libs/utils/threadutils.cpp +++ b/src/libs/utils/threadutils.cpp @@ -10,7 +10,12 @@ namespace Utils { bool isMainThread() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0) + // TODO: Remove threadutils.h and replace all usages with: + return QThread::isMainThread(); +#else return QThread::currentThread() == qApp->thread(); +#endif } } // namespace Utils