PDA

View Full Version : Restart Application



d4rc
12th May 2010, 19:09
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 :D

JD2000
12th May 2010, 19:30
What caused it to stop?

d4rc
13th May 2010, 10:32
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

JD2000
13th May 2010, 11:12
Will restarting the app work?

I think that all you need to do is use

void QWidget::setWindowState ( Qt::WindowStates windowState ) with
Qt::WindowFullScreen
or whatever

Lykurg
13th May 2010, 11:18
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.:

void MyMainWindow::changeScreenState(bool fullscreen)
{
if (fullscreen)
showFullScreen();
else
showMaximized();
}

d4rc
13th May 2010, 11:25
hmm, i need something to restart this aplication, to pass again in main.cpp

squidge
13th May 2010, 13:34
Why does main.cpp need to know? Your main widget (perhaps mainWindow.cpp) can just be sent a signal.

d4rc
13th May 2010, 15:07
how i call the mainWindow, give me error...

JD2000
13th May 2010, 15:24
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