开发者

URL encode in Qt4

开发者 https://www.devze.com 2023-01-06 15:10 出处:网络
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\'开发者_JS

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'开发者_JS百科t see any equivalent method. Is there something I'm missing?


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


You want QUrl::setEncodedUrl and QUrl::toEncoded


Qt3 support members for QUrl points to Stephen Chu's answer. Just added the link since it might be useful..

0

精彩评论

暂无评论...
验证码 换一张
取 消