From dd5ec222ce0285bd9419c9a47a8329bda41b5dd8 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Wed, 27 Oct 2010 11:22:31 +0100 Subject: Set SpectrumAnalyserThread parent to 0 before calling moveToThread() QObjects with a parent cannot be moved to a different thread. --- demos/spectrum/app/spectrumanalyser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demos/spectrum/app/spectrumanalyser.cpp b/demos/spectrum/app/spectrumanalyser.cpp index 1cc47a6..2fa17b1 100644 --- a/demos/spectrum/app/spectrumanalyser.cpp +++ b/demos/spectrum/app/spectrumanalyser.cpp @@ -64,6 +64,8 @@ SpectrumAnalyserThread::SpectrumAnalyserThread(QObject *parent) #endif { #ifdef SPECTRUM_ANALYSER_SEPARATE_THREAD + // moveToThread() cannot be called on a QObject with a parent + setParent(0); moveToThread(m_thread); m_thread->start(); #endif -- cgit v0.12