'QFile create link to file with arguments

I want to create a link to a file using the QFile::link() method. It works with files without any argument, but now I need to link to an .exe file with arguments.

QFile(qApp->applicationFilePath()).link(QDir().homePath() + QString("/Desktop/AppArg.lnk"))

My problem is that I can't set any arguments in the destination path.

I've tried:

QFile(qApp->applicationFilePath() + " argument").link(QDir().homePath() + QString("/Desktop/AppArg.lnk"))

The shortcut looks like this:

that

but it should look like this:

that

Is there any way to create a link / shortcut with arguments?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source