What is the actualy question? Is it how to wire the signals? You example
code is pretty pseudo-ish so I am not sure what you are doing and maybe not
showing here, but make sure to wire together the signals from the thread
and the main class in the constructor of the main class:

TestInstance.ThreadSignal.connect(self.MainSignal)



On Saturday, December 15, 2012, PBLN RAO wrote:

> i have a requirement where my execution will happen in threads and i want
> to emit signal from that thread to main class. below is my example code
> snippet, where i created the an instance of MainClass and assigned it to
> temp. where MainClass internally is connected to a thread Thread1 where the
> actual work will happen. when the signal is emitted from Thread1 i want the
> signalcalled definition to be executed which is connected from temp
>
> Code snippet
>
> class Thread1(QtCore.QThread):
>
>     ThreadSignal = QtCore.pyqtSignal(str)
>
>     While True:
>
>         #some statments
>         if Condition:
>             ThreadSignal.emit('Yes')
>         else:
>             ThreadSignal.emit('No')
>
> class MainClass(QtCore.QObject):
>
>     MainSignal = QtCore.pyqtSignal(str)
>
>     Testinstance = Thread1()
>
> def signalcalled(s):
>
>     print s
>
> if __name__=='__main__':
>     app = AtGui.QApplication(sys.argv)
>     temp = MainClass()
>     temp.MainSignal.connect(signalcalled)
>     sys.exit(app.exec()_)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To post to this group, send email to 
> [email protected]<javascript:;>
> .
> To unsubscribe from this group, send email to
> [email protected] <javascript:;>.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].


Reply via email to