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

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 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.

    JonBJ 1 Reply Last reply
    0
    • B BridgerMiles

      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.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on 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
      1
      • JonBJ JonB

        @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 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.

        JonBJ 1 Reply Last reply
        0
        • B BridgerMiles

          @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.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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
          1
          • JonBJ JonB

            @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 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
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on 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

              • Login

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