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. QDesktopServices openUrl doesnt work compiled
QtWS25 Last Chance

QDesktopServices openUrl doesnt work compiled

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.7k 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.
  • A Offline
    A Offline
    Aroc
    wrote on last edited by
    #1

    Hello

    Hope someone can help me.

    I made a Gui with a pushbutton, and added the slot _clicked() to it. when i run the hole thing from mvsc -> f5, it works fine. But when i try to click on the button when i started the compiled exe itself, it gives me the following error:

    alt text

    I even tried to run the windeployqt.exe to get all libs ect, but it didnt helped.

    What im missing?

    A 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What button are you clicking ? What is it supposed to do ?

      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
      0
      • A Offline
        A Offline
        Aroc
        wrote on last edited by Aroc
        #3

        hi

        Its just a push-button that i dragged over with the qt creator.

        Whats supposed todo is open the url:

        void Test::on_pushButton_6_clicked()
        {
            QString link = "http://google.com/";
            QDesktopServices::openUrl(QUrl(link));
        }
        
        

        As said, when i press F5 in VS, it works fine. but when i start the exe manually, it fails to open the url and shows that msg

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Looks like a chrome error. Can you try again changing your default navigator temporarily ?

          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
          1
          • A Aroc

            Hello

            Hope someone can help me.

            I made a Gui with a pushbutton, and added the slot _clicked() to it. when i run the hole thing from mvsc -> f5, it works fine. But when i try to click on the button when i started the compiled exe itself, it gives me the following error:

            alt text

            I even tried to run the windeployqt.exe to get all libs ect, but it didnt helped.

            What im missing?

            A Offline
            A Offline
            ambershark
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • A Offline
              A Offline
              Aroc
              wrote on last edited by
              #6

              idk how it could be a chorme error when it works inside vc :O

              Anyway, i tried and changed default browser to edge, and it works then.

              Anything i can do to get it working for chrome too?

              A 1 Reply Last reply
              0
              • A Aroc

                idk how it could be a chorme error when it works inside vc :O

                Anyway, i tried and changed default browser to edge, and it works then.

                Anything i can do to get it working for chrome too?

                A Offline
                A Offline
                ambershark
                wrote on last edited by ambershark
                #7

                @Aroc You aren't doing anything wrong. Your code is fine.

                I would try reinstalling chrome. I had a similar issue (non-coding related) the other day when using a new browser Vivaldi.

                Every time I set it to handle URLs as default it would crash when applications tried using it. After setting my defaults back to microsoft, rebooting, then resetting vivaldi to handle all it's defaults, it works now.

                So you are probably just experiencing a windows/chrome integration issue like I was with vivaldi.

                Microsoft does this on purpose I think.. they hate when people use anything that isn't IE/Edge. ;)

                Oh and as far as I know there is nothing in Qt's handling of the desktop services that changes what it sends to an application from debug vs release mode. You can of course look at Qt's code if you're truly curious.

                1 Reply Last reply
                1

                • Login

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