Re: Problems with a QThread
destructor of your class WaveEncoder is calling when you leave function WaveWidget::cutSound(). You need to do like this
Code:
void WaveWidget::cutSound()
{
m_encodeThread = new WaveEncoder(m_SoundName, m_outputDir, false, m_wave, m_WaveDisplay);
m_encodeThread->start();
Re: Problems with a QThread
Quote:
Originally Posted by
borisbn
destructor of your class WaveEncoder is calling when you leave function WaveWidget::cutSound(). You need to do like this
Code:
void WaveWidget::cutSound()
{
m_encodeThread = new WaveEncoder(m_SoundName, m_outputDir, false, m_wave, m_WaveDisplay);
m_encodeThread->start();
I did it and now I get this error:
Quote:
ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread"
I hope to get help to solve my problem
Re: Problems with a QThread
try this in constructor of your thread:
Code:
moveToThread( this );
Re: Problems with a QThread
Quote:
Originally Posted by
borisbn
try this in constructor of your thread:
Code:
moveToThread( this );
I have another problem.
I would be notified when a thread finish
Re: Problems with a QThread
ok, attach your code to your next reply in zip archive (widget's and thread's cpp- and h- files).
actualy working code in WaveEncoder::run() function doesn't need, if only it doesn't emitting signals to main widget
Re: Problems with a QThread
Quote:
Originally Posted by
borisbn
ok, attach your code to your next reply in zip archive (widget's and thread's cpp- and h- files).
actualy working code in WaveEncoder::run() function doesn't need, if only it doesn't emitting signals to main widget
Hi actually the run fuction doesn't emit any signal. It only call a routine.
How can I attach here a zip archive?
Re: Problems with a QThread
click "Reply to Thread", then "Go Advanced", and click "Manage Attachments"
Re: Problems with a QThread
make a slot in your class and connect QThread::finished() signal to it.
Re: Problems with a QThread
Quote:
Originally Posted by
borisbn
click "Reply to Thread", then "Go Advanced", and click "Manage Attachments"
Done! It doesn't accept zip attachments
Re: Problems with a QThread
Quote:
Originally Posted by
franco.amato
Done! It doesn't accept zip attachments
yes, after "Qt Centre has been moved to a new hosting" really doesn't work. and I can't see your initial code (only plain text). repeat your first message, please