[PyKDE] qt.qApp, subclassing QApplication

axel.mittendorf at transfertech.de axel.mittendorf at transfertech.de
Thu Jan 15 11:59:00 GMT 2004

in my application I want to subclass qt.QApplication and 
use this subclass instead of QApplication. Some of my 
modules are automatically generated by pyuic and I am
not allowed to change their source code. The problem
is these modules do "from qt import *" and use an object
called "qApp" which seems to be an instance of qt.Application
and I want them to use my subclass (exactly its instance) 
instead of "qApp". How can I solve this?

I wondered to overwrite qApp with my instance, does this 
work? Or will "qApp" be overwritten when a module does
"from qt import *"?

Can you tell me what qt.App is and what it is used for?
I heared it was an instance of QApplication and I heared 
there can be only one QApplication instance in an application, 
but when I compare my own instance (which I have created in 
my code) with qApp ( "app is qApp") the result is false.
So, are "app" and "qApp" two independent instances of
QApplication? Could there be more than one?

I pray you can help me;-)


More information about the PyQt mailing list