Unsolved error: ‘class QUrl’ has no member named ‘setEncodedUrl’; did you mean ‘toEncoded’?
-
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
makethe 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
classhttpd.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?
-
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. -
Re: error: ‘class QUrl’ has no member named ‘setEncodedUrl’; did you mean ‘toEncoded’?
What about encodedHost?
-
http://doc.qt.io/qt-5/qurl-obsolete.html#encodedHost
"This function is equivalent to calling QUrl::toAce() on the return value of host()."