Hi all
I want to play some QSound objects via QThread but i couldnt do it.It make a failure notice.

It says ;

QObject: Cannot create children for a parent that is in a different thread.
(Parent is QApplication(0xbefffd10), parent's thread is QThread(0x8d93a0), current thread is myThread(0xbAlignment trap: deneme (957) PC=01
efffcd0)
Bus error


Qt Code:
  1. QSound sound = new QSound("a.wav");;
  2. void myThread::run()
  3. {
  4. printf("thread is running\n");
  5. forever{
  6. printf("thread is in forever loop\n");
  7. mutex.lock();
  8. bool MultiSound = this->MultiSound;
  9. int SingleSType = this->SingleSType;
  10. int mFrequency = this->mFrequency;
  11. bool GSoundType= this->GSoundType;
  12. mutex.unlock();
  13.  
  14. if(!MultiSound)
  15. {
  16. if(sound->isAvailable())
  17. {
  18. sound->play();
  19. }
  20. }
  21. if(abort)
  22. return;
  23. }
  24. mutex.lock();
  25. if(!restart)
  26. condition.wait(&mutex);
  27. mutex.unlock();
  28. }
To copy to clipboard, switch view to plain text mode 


Do you have any suggestion?