Hi Philip,
I have not the mentioned code available here, in general for integrating Ice with a GUI you could review the ChatDemo code and articles most is still applicable to python.
Most important thing you should use asynchronous calls to avoid blocking the Ui thread and keep your interface responsive.
Also you should use the relevant GUI mechanism for invoke in the Ui thread from no UI threads in Qt this mechanism is QApplication.postEvent.
So in Qt python when you want to send a message from a non Ui thread to the UI thred, for example in an AMI callback implementation you can do
Code:
QtCore.QCoreApplication.postEvent(self.chatView, SayEvent("foo", "bar"))
The view that receives the event selft.chatView could handle this event reimplementing customEvent
Code:
def customEvent(self, event):
if(event.type() == QtCore.QEvent.Type(1024)):
# do the work in ui thread.
self.txtMessage.addMessage(event.creationDate,event.name,event.message)
And you can define your custom events with code like.
Code:
class SayEvent(QtCore.QEvent):
def __init__(self, name, message):
QtCore.QEvent.__init__(self,QtCore.QEvent.Type(1024))
self.name = name
self.message = message
Hope this help,
Let's us know if you have further problems integrating Ice with PyQt4