473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

PyQT: qt.qApp

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
Jul 18 '05 #1
2 4843
"Axel Mittendorf" <ne*******@transfertech.de> 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
Jul 18 '05 #2
"Axel Mittendorf" <ne*******@transfertech.de> wrote in message news:<bu*************@news.t-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
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ulysses | last post by:
hi. I do a P2P program use PYQT nc . It work normally in win2000,winXP. But it cann't show Chinese textLabel in windows98. For show Chinese textLabel I need convert QString instance to...
35
by: Vamsi Mudrageda | last post by:
I am kind of new to Python, and after trying and using wxPython, I found it kind of lacking in easy-to-read documentation, speed at loading, and GUI response-time. So I am looking for an another...
0
by: axel.mittendorf | last post by:
Hi, I got a problem in a multithreaded PyQT application that uses the translate method from the QApplication class. The last thing it does is: self.cmd_anything.setAccel(self.__tr("Alt+S")) ...
8
by: simo | last post by:
OK, so I'm at the stage where I want to make a choice between wxPython and PyQt. Currently I'm using wxPython mainly due to the fact that it has GPL Linux and Windows versions. I prefer Qt to...
2
by: Sibylle Koczian | last post by:
Still trying to learn PyQt from a book about several Python GUI toolkits, I seem to learn first what doesn't work. The following small script seems to work, but after closing the window I get the...
10
by: Peter | last post by:
I want to draw some lines on a widget. This works ok, but when I want to redraw, the old lines are still there. How do I clear or refresh the widget, so I can draw a new set of lines? Code...
10
by: svenn.are | last post by:
Hi, I wanted to run a program that is written in PyQt on my mac, and went over to Riverbank to get PyQ 3.13 and SIP 4.1.1 sources. I followed the installation guide except for the compiling...
10
by: Simon John | last post by:
After quite a while of wxPython I'm getting back into PyQt, mainly due to the announcement by Trolltech that they will make a GPL version of Qt4 for Windows (and Phil-T said he will make a PyQt to...
10
by: Volker Lenhardt | last post by:
For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I try to layout my data output in a QScrollView as the central widget. I'd prefer to use QGridLayout, but cannot add it to the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.