Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved More QCommandLineParser options in custom webengine app

    General and Desktop
    3
    3
    94
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Alexander M. J last edited by Alexander M. J

      Hi,

      I'm making my own frontend for qtwebengine (a simplebrowser/quicknanobrowser). Currently I need to pass some startup parameters.

      This is my code

      int main(int argc, char** argv) {
        QCommandLineParser parser;
        parser.setApplicationDescription("The Browser");
        parser.addHelpOption();
        parser.addVersionOption();
        QCommandLineOption targetDirectoryOption(
            QStringList() << "i"
                          << "isolation",
            QCoreApplication::translate("main", "Isolate the browser for a certain <domain>."),
            QCoreApplication::translate("main", "domain"));
        parser.addOption(targetDirectoryOption);
        parser.process(app);
        return QApplication::exec();
      

      Now the problem starts when I try to give it extra startup parameters such as --no-sandbox or --remote-debugging-port intended for QtWebEngine. My program stops execution and gives following error:

      browser: Unknown options: remote-debugging-port, disable-features.
      

      How can I both support my startup flags but also keep using the ones intended for webengine/chromium ?

      raven-worx 1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Your code snippet is incomplete so it's impossible to reproduce your issue.

        In any case, if implemented correctly the additional parameters you pass using the parser should have no influence on the other since they should be pared first.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • raven-worx
          raven-worx Moderators @Alexander M. J last edited by

          @Alexander-M-J said in More QCommandLineParser options in custom webengine app:

          My program stops execution and gives following error:
          browser: Unknown options: remote-debugging-port, disable-features.

          How can I both support my startup flags but also keep using the ones intended for webengine/chromium ?

          did you also provide a value for the parameter?
          https://doc.qt.io/qt-5/qtwebengine-debugging.html#qt-webengine-developer-tools

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply Reply Quote 0
          • First post
            Last post