From 3ed781ce1e5306cb98359fc620e59d379700f48b Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 18 Mar 2023 17:11:20 +0100 Subject: [PATCH] Gui: solves #8939: timers are moved between non-QThreads For more details see: https://github.com/FreeCAD/FreeCAD/issues/8939#issuecomment-1474888902 --- src/Gui/Tree.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index f13015e066..7cf6c32644 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -33,6 +33,7 @@ # include # include # include +# include # include # include # include @@ -757,6 +758,12 @@ void TreeWidget::updateStatus(bool delay) { } void TreeWidget::_updateStatus(bool delay) { + // When running from a different thread Qt will raise a warning + // when trying to start the QTimer + if (Q_UNLIKELY(thread() != QThread::currentThread())) { + return; + } + if (!delay) { if (!ChangedObjects.empty() || !NewObjects.empty()) onUpdateStatus();