Results 1 to 6 of 6

Thread: Restart QApplication

  1. #1
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    4
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Question Restart QApplication

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Restart QApplication

    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.

  3. #3
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    4
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Lightbulb Re: Restart QApplication

    Thanks Wysota, for the interest.

    Quote Originally Posted by wysota View Post
    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

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Restart QApplication

    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?

  5. #5
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    4
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Question Re: Restart QApplication

    Thanks for the Info, Wysota.

    Quote Originally Posted by wysota View Post
    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

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Restart QApplication

    Quote Originally Posted by Svaths View Post
    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.

  7. The following user says thank you to wysota for this useful post:

    Svaths (8th February 2007)

Similar Threads

  1. Replies: 15
    Last Post: 21st April 2007, 17:46
  2. qapplication with open(/dev/name,O_RDWR) crashed???
    By ttbug in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 16th September 2006, 07:56
  3. Reponsabilities of QApplication and QMainWindow classes
    By yellowmat in forum Qt Programming
    Replies: 4
    Last Post: 4th September 2006, 16:21
  4. Can I create a QApplication inside a DLL?
    By oob2 in forum Qt Programming
    Replies: 6
    Last Post: 1st July 2006, 10:08
  5. subclassing QApplication
    By nupul in forum Newbie
    Replies: 2
    Last Post: 19th April 2006, 19:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.