QProcess takes the first parameter as the command to run and then passes the following arguments, delimited by a space, as arguments to the command.
When you do this: -
QStringList param = ( QStringList << "--message my Text" << "path/to/script.sh")
And then pass param to QProcess, it's passing "path/to/script.sh" as a command line parameter to gksudo, but what you want is a single argument with --message. You need to unify the parameters with extra quotes. So, in the case of your last example, that would be: -
QString cmd = QString("/usr/bin/gksudo \"--message MyText"\");
Note the two additional \" around --message MyText
Passing this to QProcess means there are two arguments; the call to gksudo and its command line argument "--message MyText"