Results 1 to 6 of 6

Thread: Restore the GUI to previous state when System signal occurs

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Restore the GUI to previous state when System signal occurs

    You don't need to sync() in this situation, because the object gets synced when it's deleted. Does the signal handler actually get called?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Restore the GUI to previous state when System signal occurs

    Also, looks like you create a new MainWindow object in sighandler(). It's not the original window you have shown but another object..
    J-P Nurmi

  3. #3
    Join Date
    Jun 2006
    Location
    San Diego, USA
    Posts
    95
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Restore the GUI to previous state when System signal occurs

    It worked now, it was just the way I was calling the writeSettings function.

    Here is the way I handled the signal for MainWindow.
    signal(SIGTERM, MainWindow::writeSettings);

    And declared static void writeSettings(int sigNum); in header file under public.
    And thus this function has been called when SIGTERM signal is caught.

    Thanks to all who supported me in correcting me from doing faults.

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
  •  
Qt is a trademark of The Qt Company.