Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL encode in Qt4

Tags:

urlencode

qt

qt4

I'm trying to encode a URL while using Qt 4. It looks like in Qt 3, the method was QUrl::encode, but apparently QUrl was rewritten from Qt 3 to Qt 4. I looked in the documentation and didn't see any equivalent method. Is there something I'm missing?

like image 896
icktoofay Avatar asked Jul 12 '10 03:07

icktoofay


2 Answers

Also use QUrl::toPercentEncoding to encode any QString without forming it to a URL.

like image 96
Stephen Chu Avatar answered Oct 28 '22 12:10

Stephen Chu


You want QUrl::setEncodedUrl and QUrl::toEncoded

like image 33
sje397 Avatar answered Oct 28 '22 10:10

sje397