Important: Please read the Qt Code of Conduct -

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

    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";

    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

    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";@

    Try this instead:
    @arguments << "--chrome-frame" << "-kiosk" << "";@

  • That did it. Thank you :)

  • Banned

    This post is deleted!

Log in to reply