Hi, everyone,

This forum has been wonderfully useful in my attempts to deploy a phonon-using python app for the Mac. I hope I can get some advice on this next error.

I have a music player script, very strongly based on the Qt 4.4.3 Music Player example here (although this example is in C++ and mine is in python, obvy).

When I run the script locally, it works as expected -- I can double-click on a track, or select the track and click the "play" button, and I hear the track's audio, the seekSlider advances, and the digital display advances.

However, when I run the app created by py2app -- via the following command:

python setup.py py2app --includes sip --extension .app -O2

the resulting app plays the audio, but the seekSlider does not advance, the digital display does not advance, and I receive the following error in the console:


QObject: Cannot create children for a parent that is in a different thread.
(Parent is Phonon::AudioOutput(0x13e48080), parent's thread is QThread(0x1e9a20), current thread is QThread(0x13e4dea0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Phonon::MediaObject(0x13e47e00), parent's thread is QThread(0x1e9a20), current thread is QThread(0x13e4dea0)
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject: Cannot create children for a parent that is in a different thread.
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Phonon::MediaObject(0x13e482c0), parent's thread is QThread(0x1e9a20), current thread is QThread(0x13e4dea0)
QObject::connect: Cannot queue arguments of type 'MediaSource'
(Make sure 'MediaSource' is registered using qRegisterMetaType().)

...


I do not do any threading myself, so I'm not sure how to persuade a wrong thread to be a right one.

I am now doing the following phonon object instantiations in __init__()

self.ui.mediaObject = Phonon.MediaObject(self)
self.ui.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
self.ui.metaInformationResolver = Phonon.MediaObject(self)


although it doesn't seem to be making much a difference from the old way I was doing it, which is this:

self.ui.mediaObject = Phonon.MediaObject()
self.ui.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory)
self.ui.metaInformationResolver = Phonon.MediaObject()



I have also tried mediaObject.moveToThread(self.thread()), to no avail. It actually appears that mediaObject.thread() == self.thread().


I am using Mac OS X, Qt 4.4.3, python 2.6.

Any guidance you can provide would be deeply appreciated. I feel like I'm inches away from success!