I am new to PyQt4 (and QT in general) and am facing a problem,
I have subclasses of QApplication (to have global data and functions that are truly global to the application):
class App(QApplication): def __init__(self): QApplication.__init__(self) self.foo = None def bar(self,x): do_something()
When I try to add a slot to my main window, for example:
self.connect(bar, SIGNAL('triggered()'), qApp.bar)
I get an error: AttributeError: bar
What am I doing wrong? Or should I make the material I want global, global stuff instead of the attributes and methods of the QApplication subclass? (or something else, if so, then what?)
Note: all this worked perfectly when the "global" methods and attributes were in my QMainWindow class ...
source share