Gui: solves #8939: timers are moved between non-QThreads
For more details see: https://github.com/FreeCAD/FreeCAD/issues/8939#issuecomment-1474888902
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
# include <QMenu>
|
||||
# include <QMessageBox>
|
||||
# include <QPixmap>
|
||||
# include <QThread>
|
||||
# include <QTimer>
|
||||
# include <QToolTip>
|
||||
# include <QVBoxLayout>
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user