PDA

View Full Version : Restart QApplication



Svaths
8th February 2007, 09:23
Hello all,

I am using Qt 3.3 Embedded Version.


1.) As part of our requirement, I intend to "RESTART" Qt alone leaving my application and data unerased.
Can it be done? Do I need to 'QApplication::exit(0)' and create a new 'QApplication myapplication' again?? Or is there a better way around??

2.) Currently Qt is opening Frame Buffer fb0 to write on to my LCD.
Is there a way by which I can switch between the FrameBuffers fb0 and fb2?
Atleast if there could be a way to disconnect and connect to the same frame buffer again from my application, it would be of great help to me....


Thanks in advance...





Regards,
Svaths

wysota
8th February 2007, 10:52
What exactly do you mean by a "restart"? You can try just exiting and reentering the event loop. I guess pending events will be processed then, but I don't know if that's what you want.

Svaths
8th February 2007, 11:22
Thanks Wysota, for the interest.


What exactly do you mean by a "restart"?

By "Restart", I Intend the QApplication to initiate startup like connecting to my framebuffer, keypad again.

The Problem:

When a certain event occurs, I need to stop writing into frame buffer fb0 and start writing to frame buffre fb2 and after a certain event, I need to revert it back

My Approach

(i) I planned to exit ( QApplication:;exit(0) ) , softlink fb0->fb2 and create a QApplication fresh so that it connects to fb0 again which is actually fb2. I could not easily do it...

After a proper exit , during recreation of QApplication,......... it said

#Semop lock failure Identifier removed
#Semop unlock failure Identifier removed

and it hung

(ii) If I can switch between the frame buffers fb0 anf fb2 when required, the problem could be solved.... But I dont know if it is possible:confused:

Hence the reason, I was looking for a way out to RESTART QApplication without having to exit and create a new one...

Hope I am a bit clear now.........




Thanks in advance.....

Regards,
Svaths

wysota
8th February 2007, 11:45
I don't think you can create a second application object. Maybe it'd be easier to save the state somewhere, restart the application completely and restore the state?

Svaths
8th February 2007, 12:38
Thanks for the Info, Wysota.


Maybe it'd be easier to save the state somewhere, restart the application completely and restore the state?

You meant the Session Manager, I Suppose. I shall surely try this. Thanks.

Regarding the Frame Buffers, Can I assume that there is no safe way to switch between frame buffers dynamically??


Thanks in advance,
Regards,
Svaths

wysota
8th February 2007, 12:54
You meant the Session Manager, I Suppose. I shall surely try this. Thanks.
I meant any mechanism. You can use the session manager but you can also just dump the state to some file.


Regarding the Frame Buffers, Can I assume that there is no safe way to switch between frame buffers dynamically??

I don't know much about embedded systems, so I can't confirm that, but it's highly unprobable that such a method exists. You can't reconnect to a different X server on the fly, so probably you also can't reconnect to a different framebuffer on the fly.