Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > PyQT: qt.qApp

Reply
Thread Tools

PyQT: qt.qApp

 
 
Axel Mittendorf
Guest
Posts: n/a
 
      01-14-2004
Hello,
in my application I want to subclass qt.QApplication and
use this subclass instead of QApplication for my gui. 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.QApplication
and I want them to use my subclass (exactly its instance)
instead of 'qApp'. How can I solve this?

Can someone tell me what qt.qApp is and what it is used for?
(I'm using PyQT 3.6.)

TIA,
Axel


 
Reply With Quote
 
 
 
 
John J. Lee
Guest
Posts: n/a
 
      01-15-2004
"Axel Mittendorf" <(E-Mail Removed)> writes:
[...]
> in my application I want to subclass qt.QApplication and
> use this subclass instead of QApplication for my gui. 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.QApplication


IIRC, qApp is *the* QApplication (there's only one QApplication
instance per application).


> and I want them to use my subclass (exactly its instance)
> instead of 'qApp'. How can I solve this?


I have a vague recollection that you can't, due to an obscure
limitation of either Qt or PyQt (or sip, maybe). That might have
changed by now, though: ask on the PyKDE list.


> Can someone tell me what qt.qApp is and what it is used for?
> (I'm using PyQT 3.6.)


See above.


John
 
Reply With Quote
 
 
 
 
Roberto Alsina
Guest
Posts: n/a
 
      01-15-2004
"Axel Mittendorf" <(E-Mail Removed)> wrote in message news:<bu3pph$qma$01$(E-Mail Removed)-online.com>...
> Hello,
> in my application I want to subclass qt.QApplication and
> use this subclass instead of QApplication for my gui. 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.QApplication
> and I want them to use my subclass (exactly its instance)
> instead of 'qApp'. How can I solve this?
>
> Can someone tell me what qt.qApp is and what it is used for?
> (I'm using PyQT 3.6.)


Well, there are some times when you need to call a method of
QApplication.

For example, if you want to put a hourglass cursor for the whole app,
you call
qApp.setOverrideCursor

Anyway, you shouldnīt worry about this. Whatever object you create
that inherits QApplication will be qApp. Since there can only be one
of those, there is no way itīs gonna get confused

--
Roberto Alsina
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments