Apteronotus
Apteronotus

Reputation: 56

QProcess won't start the requested

I have been trying to get QProcess to start up an application. But I am facing a few problems in doing so. Here's my code:

void QOpenApp::open_now()
{
    QString program = "/usr/lib/qt4/examples/widgets/analogclock";
    QStringList arguments;
    arguments << "-style" << "motif";

    process->start(program, arguments);
}

I am on Ubuntu 12.04. All I get is an output message "Starting blah blah" and nothing else happens. The program does not quit and is still running but the Analog Clock (the App I am trying to open using QProcess) does not start up.

Upvotes: 0

Views: 381

Answers (1)

sashoalm
sashoalm

Reputation: 79665

The path you're giving is incorrect - I just checked on my computer, and /usr/lib/qt4/examples/widgets/analogclock is a directory, the actual executable is /usr/lib/qt4/examples/widgets/analogclock/analogclock.

Remember when you use QProcess, you always need to give it correct paths - it won't work otherwise.

Upvotes: 2

Related Questions