Results 1 to 9 of 9

Thread: Restart Application

  1. #1
    Join Date
    Apr 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Restart Application

    I need restart the application, i need know how do this. Exist a function to restart e.g "restart()"?


    I use QT and I like it

  2. #2
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Restart Application

    What caused it to stop?
    Got to keep the loonies on the path ...

  3. #3
    Join Date
    Apr 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Restart Application

    I launch a dialog asking if he want a fullscreen or maximized and this save in bd a bool, and i need restart to pass again in main.cpp that read this bool

  4. #4
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Restart Application

    Will restarting the app work?

    I think that all you need to do is use
    Qt Code:
    1. void QWidget::setWindowState ( Qt::WindowStates windowState )
    To copy to clipboard, switch view to plain text mode 
    with
    Qt Code:
    1. Qt::WindowFullScreen
    To copy to clipboard, switch view to plain text mode 
    or whatever
    Got to keep the loonies on the path ...

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Restart Application

    Well then you don't need a restart! just create a private slot which reacts on the user decision and change to full screen of maximized. E.g.:
    Qt Code:
    1. void MyMainWindow::changeScreenState(bool fullscreen)
    2. {
    3. if (fullscreen)
    4. showFullScreen();
    5. else
    6. showMaximized();
    7. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Apr 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Restart Application

    hmm, i need something to restart this aplication, to pass again in main.cpp

  7. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Restart Application

    Why does main.cpp need to know? Your main widget (perhaps mainWindow.cpp) can just be sent a signal.

  8. #8
    Join Date
    Apr 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Restart Application

    how i call the mainWindow, give me error...

  9. #9
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Restart Application

    Are you asking how to send a signal from the dialog to the widget/window?

    If so try reading the official documentation http://doc.trolltech.com/4.6/signalsandslots.html
    Got to keep the loonies on the path ...

Similar Threads

  1. how to restart the MainWindow?
    By d@nyal in forum Newbie
    Replies: 2
    Last Post: 3rd May 2010, 03:51
  2. QTime restart
    By jhowland in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2008, 20:18
  3. Replies: 1
    Last Post: 10th August 2008, 18:55
  4. How to restart an application?
    By xylosper in forum Qt Programming
    Replies: 2
    Last Post: 12th August 2007, 13:04
  5. Restart QApplication
    By Svaths in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 8th February 2007, 11:54

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.