Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qurl
Forum Update on Monday, May 27th 2025

Qurl

Scheduled Pinned Locked Moved Unsolved General and Desktop
qurl tabswinowstabsqurlgoogle
6 Posts 3 Posters 2.6k Views
  • 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.
  • B Offline
    B Offline
    BridgerMiles
    wrote on 16 Mar 2019, 07:25 last edited by BridgerMiles
    #1

    How do I open multiple windows using QURL I currently have it set so when I click one button it opens a tab using the default browser. When I click the second button it opens another tab in the same Google chrome window. How do I make it so the second button opens the tab in a new chrome window. I don't want it to use the window that's already open.

    J 1 Reply Last reply 16 Mar 2019, 10:41
    0
    • B BridgerMiles
      16 Mar 2019, 07:25

      How do I open multiple windows using QURL I currently have it set so when I click one button it opens a tab using the default browser. When I click the second button it opens another tab in the same Google chrome window. How do I make it so the second button opens the tab in a new chrome window. I don't want it to use the window that's already open.

      J Offline
      J Offline
      JonB
      wrote on 16 Mar 2019, 10:41 last edited by
      #2

      @BridgerMiles
      QUrl (https://doc.qt.io/qt-5/qurl.html) in itself just handles URLs, it does not "open windows". Before we can answer whether you can achieve what you ask, tell us what code you have where you are using these QUrls and how you "open" them?

      B 1 Reply Last reply 16 Mar 2019, 13:07
      1
      • J JonB
        16 Mar 2019, 10:41

        @BridgerMiles
        QUrl (https://doc.qt.io/qt-5/qurl.html) in itself just handles URLs, it does not "open windows". Before we can answer whether you can achieve what you ask, tell us what code you have where you are using these QUrls and how you "open" them?

        B Offline
        B Offline
        BridgerMiles
        wrote on 16 Mar 2019, 13:07 last edited by
        #3

        @JonB QDesktopServices::openUrl("www.google.com");
        QDesktopServices::openUrl("www.facebook.com");
        is Cody's executed Google opens in the first tab and Facebook opens in the second. I needed to open Google in one chrome window and Facebook and another chrome window.

        J 1 Reply Last reply 16 Mar 2019, 14:20
        0
        • B BridgerMiles
          16 Mar 2019, 13:07

          @JonB QDesktopServices::openUrl("www.google.com");
          QDesktopServices::openUrl("www.facebook.com");
          is Cody's executed Google opens in the first tab and Facebook opens in the second. I needed to open Google in one chrome window and Facebook and another chrome window.

          J Offline
          J Offline
          JonB
          wrote on 16 Mar 2019, 14:20 last edited by JonB
          #4

          @BridgerMiles
          I don't think you're going to be able to make openUrl() open a new window, rather than its default of a new tab.... I don't see it allows target=, and anyway I don't think that would help, it seems to be doing equivalent of target="_blank" already. It's really down to how your browser is set up, I think you'll find your Chrome browser is set to do new tabs rather than new windows, unless you change that there's nothing openUrl() can do to alter that behaviour.

          B 1 Reply Last reply 16 Mar 2019, 21:24
          1
          • J JonB
            16 Mar 2019, 14:20

            @BridgerMiles
            I don't think you're going to be able to make openUrl() open a new window, rather than its default of a new tab.... I don't see it allows target=, and anyway I don't think that would help, it seems to be doing equivalent of target="_blank" already. It's really down to how your browser is set up, I think you'll find your Chrome browser is set to do new tabs rather than new windows, unless you change that there's nothing openUrl() can do to alter that behaviour.

            B Offline
            B Offline
            BridgerMiles
            wrote on 16 Mar 2019, 21:24 last edited by
            #5

            @JonB ok thank you do you have any links or resources I can look into to find a way to make this work.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 16 Mar 2019, 22:25 last edited by
              #6

              Hi
              Alternatively, you could use QProcess and start it with

                  QString program = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe";
                  QStringList arguments;
                  arguments << "--new-window" << "https://forum.qt.io";
                  QProcess chromeProcess;
                  if ( ! chromeProcess.startDetached(program, arguments) ) {
                      qDebug() << "error" << chromeProcess.errorString();
                  }
              
              1 Reply Last reply
              2

              1/6

              16 Mar 2019, 07:25

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved