[PyQt] connecting signals

Matt Smith melkor at orangepalantir.org
Thu Nov 27 18:35:23 GMT 2008


There is a lot of leeway in connecting signals, so I was curious about
how other people are doing it.  I have a widget layout similar to this.

MainWindow
  Menu
  CentralWidget
    TabBar
    StackedWidget
       Graph
       Calculator
    InputWidget

Everything above is a widget, and the menu is going to pretty much be
connected to everything in some way.  Where should I connect it.  As of
now in the Central widget __init__ use a line such as, 

self.Graph.connect(parent.menuWidget(),QtCore.SIGNAL("imageSaveRequest( QString )"),self.Graph.SaveImage)

I suppose the meat of the question does it matter where I connect a
widget to a signal.  I mean if I have to do it through some long ugly
expression using function calls that return widgets is it going to make
a difference once they are connected?

thanks, happy thanksgiving.
mbs



More information about the PyQt mailing list