Launching a native application from Qt
This code snippet shows how to launch a native application from Qt. The example has been tested launching the Symbian camera application on the Symbian platform, but the code should work generically.
The ProcessHandler starts the process and listens for its states.
class ProcessHandler : public QObject
ProcessHandler(QObject *parent = 0);
void stateChanged(QProcess::ProcessState state);
void error(QProcess::ProcessError error);
Create QProcess and start listening for process state changes.
if (process->state() != QProcess::NotRunning)
// Close process if it is running
Start the Symbian native camera Cameraapp.exe:
QString program = "Cameraapp.exe";
QProcess signals the error to the error slot:
QProcess signals the process state changes to the stateChanged slot.
The Symbian native camera is started.