Hi again,
now I have tested some different methods of launching external applications and files. I have used QProcess and QDesktopServices for launching. They seem to do their job as expected in Windows but with Linux QDesktopServices doesn't want to launch external applications directly. Although it opens files, for example pdf files, as expected in default PDF reader program.
Now is there a way to get QDesktopServices to launch application executables also in Linux. Or should i just use QProcess to launch executables, as it works fine.
Here's code that does it's job as expected:
QString program
= "/path/to/executable";
process->start(program, arguments);
QString program = "/path/to/executable";
QStringList arguments;
QProcess *process = new QProcess(this);
process->start(program, arguments);
To copy to clipboard, switch view to plain text mode
The following code does the job in Windows but does nothing in Linux:
QDesktopService
::openUrl(QUrl("path/to/executable"));
QDesktopService::openUrl(QUrl("path/to/executable"));
To copy to clipboard, switch view to plain text mode
So is there a way to get QDesktopServices working or should I just use QProcess to start those executables and stick with QDesktopServices with other kind of files and resources? I would really like to use just QDesktopServices to do the job because it's so simple way to launch different type of files with their default programs...
Edit: I looked the application output and it says "No application is registered as handling this file", so it seems that Linux is expecting some other application to launch these, even if the file is executable itself. Which seems quite strange... I have to take closer look at that then
Bookmarks