Using QProcess to open Google Chrome with arguments



  • Hi.

    I'm trying to open Google chrome with arguments. In the command promt i can write:

    @start chrome.exe --chrome-frame -kiosk http://www.google.com@

    In order to open Google Chrome in fullscreen. I'm trying to acheive the same thing using QProcess:

    @QString program = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe";
    QStringList arguments;
    arguments << "--chrome-frame" << "-kiosk http://www.google.com";

    QProcess *chromeProcess = new QProcess(this);
    chromeProcess->start(program, arguments);@

    It does start a new instance of Chrome, however not in fullscreen. Can someone explain what is wrong with my approach?

    Thank you.



  • In the commandline
    @-kiosk http://www.google.com@

    is interpreted as two arguments, since there is a space in between. It is the application that checks if these two follow each other, and then decides to act accordingly.
    Therefore the following is certainly wrong, even though I can't test if that's the whole cause of your troubles:
    @arguments << "--chrome-frame" << "-kiosk http://www.google.com";@

    Try this instead:
    @arguments << "--chrome-frame" << "-kiosk" << "http://www.google.com";@



  • That did it. Thank you :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.