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. error: ‘class QUrl’ has no member named ‘setEncodedUrl’; did you mean ‘toEncoded’?
Qt 6.11 is out! See what's new in the release blog

error: ‘class QUrl’ has no member named ‘setEncodedUrl’; did you mean ‘toEncoded’?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.3k Views 1 Watching
  • 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
    BeefTaco
    wrote on last edited by
    #1

    I have made a custom server using Qt, i installed in in vps with Debian GNU/Linux 9.1 (stretch), then installed qt:

    apt-get install qtcreator

    After that i have done:
    qmake -qt=qt5
    make

    the qt version output is:

    Using Qt version 5.7.1 in /usr/lib/x86_64-linux-gnu

    But then, when i try to compile my code i get errors on this methods of QUrl class

    
    httpd.cpp:210:20: error: ‘class QUrl’ has no member named ‘setEncodedUrl’; did you mean ‘toEncoded’?
             urlRequest.setEncodedUrl(
                        ^~~~~~~~~~~~~
    scpp:221:32: error: ‘class QUrl’ has no member named ‘setEncodedHost’; did you mean ‘toEncoded’?
                         urlRequest.setEncodedHost(strLine);
                                    ^~~~~~~~~~~~~~
    s.cpp:223:32: error: ‘class QUrl’ has no member named ‘setEncodedHost’; did you mean ‘toEncoded’?
                         urlRequest.setEncodedHost(strLine.left(intSepPos));
                                    ^~~~~~~~~~~~~~
    s.cpp:236:20: error: ‘class QUrl’ has no member named ‘setEncodedUrl’; did you mean ‘toEncoded’?
             urlRequest.setEncodedUrl(elements.at(1));
    

    Does qt 5.7.1 doesn't have those methods?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      They are flagged obsolete
      http://doc.qt.io/qt-5/qurl-obsolete.html
      As far as i know, setUrl can be used as it handles encoded also.

      1 Reply Last reply
      2
      • B Offline
        B Offline
        BeefTaco
        wrote on last edited by
        #3

        Re: error: ‘class QUrl’ has no member named ‘setEncodedUrl’; did you mean ‘toEncoded’?

        What about encodedHost?

        mrjjM 1 Reply Last reply
        0
        • B BeefTaco

          Re: error: ‘class QUrl’ has no member named ‘setEncodedUrl’; did you mean ‘toEncoded’?

          What about encodedHost?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          http://doc.qt.io/qt-5/qurl-obsolete.html#encodedHost
          "This function is equivalent to calling QUrl::toAce() on the return value of host()."

          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