Using Qt to open external game appplication
Posted
by
RandomGuy
on Programmers
See other posts from Programmers
or by RandomGuy
Published on 2012-07-10T10:25:50Z
Indexed on
2012/07/10
15:23 UTC
Read the original article
Hit count: 384
I have a windows qt application and I'm trying to open an external game, but I'm not having success.
Application is in C:\games\Oni\Edition\ and is called Oni.exe, the code I'm using right now is the follow:
void MainWindow::on_toolButton_clicked()
{
qint64 test=1;
if(!QProcess::startDetached("Oni.exe",QStringList(),"C:\\games\\Oni\\Edition\\",&test)){
QMessageBox msgBox;
msgBox.setText("Oni couln't be started!");
msgBox.exec();
}
}
I don't know if I'm forgetting something? The game runs fine if I double click it. Thanks.
© Programmers or respective owner