Using Qt to open external game appplication
- by RandomGuy
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.