Your code is not going to work. You are trying to connect to a signal that has 
already been emitted. For this to work, you need to manually call emitSignal 
AFTER you create your Foo() Dialog.

if dialog.exec_():
print "dialog executed"
dialog.emitSignal()

emitSignal()...
dialog executed
emitSignal()...
theString:  signal: this is foo

--
Regards,
 -Demetrius Cassidy

---- Scott Frankel <fran...@circlesfx.com> wrote: 

=============

Hi all,

How does one connect dialogs to a parent object to receive any signals  
they may emit?

This doesn't work:
                dialog = Foo()
                self.connect(dialog, QtCore.SIGNAL("foo(string)"), 
self.printString)

The attached code sample creates a dialog that emits a signal on  
init().  The main window tries to connect the dialog, receive the  
signal, and call its assigned slot.  Seems like it should work, but of  
course it doesn't.

I'm sure I'm overlooking something simple.  Thanks in advance!
Scott




_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to