tags:

views:

203

answers:

3

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

+2  A: 

QApplication is a singleton class, so its "single" by design. You can have only a single QApplication object per program.

But in Qt there is no inherent limitation of the number of qt programs using the QApplication class you can run parallel. You can have more than one program using qt (and thus very likely QApplication) at the same time.

Probably this got somehow confused in your mailing lists.

drhirsch
A: 

My guess is that one QApplication would accept the mouse event or keyboard event and therefore the other would not get it.

Its probably a little random as to which QApplication accepts which events based on having so many QApplications in a single process.

I cannot imagine the use case as to why you would want multiple QApplications within a process. Could you expand on what you are trying to do?

Phil Hannent
Original poster clarified that he meant multiple processes each with a QApplication, not multiple QApplications in one process.
Intransigent Parsnip
+2  A: 

You can run multiple processes each with one QApplication just fine.

However, with Qt for Embedded Linux, only one of these must be the QWS server. In other words, you should start the first process with `-qws', and all other processes without.

Intransigent Parsnip
Thats what I did. Executed one application as QWS server and with fullScreen. Second Application, simply as client and in normalMode.Main windows of both of them are receiving mouse press events.However the application which is in foreground(second App) is alone receiving key press events.Even If I click on the fisrt application(QWS Server, fullScreen), it does not get focusInEvent, hence no keyboard focus and no key press events. I want this App also to get key press events.
beedroid