To make a shortcut menu recently, you need to call an external. exe application.
When calling an external application, it is divided into blocking and non-blocking, which is non-blocking because of which program you want to invoke.
The method is as follows:
Using the Qprocess startdetached () method, the external program that is invoked can run as usual when the current program shuts down.
#include <QProcess> qprocess::startdetached ("E:\\qt\\qtcreator-2.4.1\\bin\\qtcreator.exe", Qstringlist ()); |
At this point the Windows system, so the path is using \ \.
Note that the parameters of the startdetached () function (see HTTP://QT-PROJECT.ORG/DOC/QT-4.8/QPROCESS.HTML#STARTDETACHED-2), the first argument is the external exe path, When the EXE path contains a space, you need to use the second parameter, if the external application only need EXE this one can be opened, the second argument written qstringlist () on it.
Other file paths are written into qstringlist () when an external application has an EXE that requires additional files to open. For example ENVI software:
Qprocess::startdetached (tr ("E:\\study program\\itt\\idl71\\bin\\bin.x86\\idlrt.exe"), QStringList ("E:\\Study Program\\itt\\idl71\\lib\\hook\\envi.sav "));
If as long as the previous EXE that is not open, you need to add a second parameter. Look at the properties of the Envi shortcut, and there are two files in the target file.
Reproduced from: http://www.cnblogs.com/Romi/archive/2012/05/03/2480374.html