Scope <or> PyQt question
dittonamed at gmail.com
Thu Jul 26 15:41:44 CEST 2007
Code pasted below ----->
Can anyone out there suggest a way to access the object "p" thats
started in playAudio() from inside the stopAudio()? I need the object
reference to use QProcess.kill() on it. The code sample is below.
Thanks to anyone who helps out =)
More comments in the code below ------>
from qt import *
def __init__(self,parent = None,name = None,fl = 0):
p = QProcess(self, 'player')
playcmd = '/usr/bin/play'
filename = 'song.ogg'
''' #This is just to show that i can "see" the object, though
#dont know how to "access" it
#the output shows the QProcess object by name...
# but how do i reference it??
allobjs = list(QObject.objectTrees())
for obj in allobjs:
objName = QObject.name(obj)
if objName == 'Form2':
QProcess.kill(NEED THE REFERENCE HERE)
More information about the Python-list