[Qt-interest] Problems with Multiple QApplications

Malyushytsky, Alex alex at wai.com
Mon Nov 2 23:29:29 CET 2009


If you look at detailed description of QApplication class :
http://doc.trolltech.com/4.5/qapplication.html
You will find that a lot of things which point that there should be only single instance of QApplication in each application.
Starting with:
"The QApplication object is accessible through the instance() function which return a pointer equivalent to the global qApp pointer." ( only ONE global pointer, not many)

You may continue with:
"QApplication's main areas of responsibility are...."

It is just designed this way.
It does not matter which system you are running on.
It has nothing to do how many widgets/windows you have opened in the same time.


If you use 2 QApplication instances it either you should have 2 different executables or 2 separated widgets.
In the first case split your project.
In the second add as many widgets/ storage classes you need, nobody is limiting you.

>> QApplications in Qt is not supported by design and why at all it is required? How can I understand this more clearly?

It is your responsibility to ask question the way people can give you useful advice.
As for now you seems asking the wrong question.
It does not make sense to ask about "Multiple QApplications". It is the same as ask why Solar system have only 1 star in it.
You may start with what you want to achieve from the user perspective.


Regards,
  Alex




-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Nitin Mahajan
Sent: Sunday, November 01, 2009 2:46 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Problems with Multiple QApplications

Hello,

Can someone help me understand what are the problems in running multiple QApplications on Qt for Embedded Linux? Please point me to some documentation of mailing-list threads.

While going through some of the mails in mailing lists, I have seen some comments which say that, running multiple QApplications in Qt is not supported by design and why at all it is required? How can I understand this more clearly?

However, while reading the document "Qt for Embedded Linux Architecture" I did not find anything which says that we should not run multiple QApplication instances at the same time.

I am executing two QApplications on a Embedded Linux platform (not a PC) and  one of them in Full Screen mode.The one which is in FullScreen mode it is not getting keyboard focus, even though it receives mousePress events. If same app is run in normalMode, it gets the mousepress event followed by focusInEvent. Can somebody provide pointers on it?

regards

-Nitin



      New Email addresses available on Yahoo!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list