Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QSound error in thread
alecs26 last edited by
I am trying to play a sound in a non-qt thread:
I receive this error:
QObject: Cannot create children for a parent that is in a different thread.
Any ideas ?
6thC last edited by
Can you create an instance and play that?
#include <QSound> ... QSound button20Sound(":/button20.wav"); button20Sound.play();
alecs26 last edited by alecs26
Thank you for your answer.
With your method, the error is not there anymore.
However, I don't hear the sound. I hear it when I play the file outside the thread (in the main).