1

I am using qt creator to make ui on windows 10.

I want to run external program using push button and to place in widget inside of qt window. Now, I create the code to run external program when I click push button, but the program just appears outside qt window. Can I run external program using push button inside of qt window and set up the location where i want? I also upload my ui portion together.

enter image description here

void MainWindow::on_pushButton_8_clicked()    
{    
    QProcess *process = new QProcess(this);
    QString file("D:\\My external file name");
    process->execute(file);
    QDesktopServices::openUrl(QUrl("file:///"+file,QUrl::TolerantMode));
}
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.