Qt4 中的 URL 编码

发布于 2024-09-09 04:48:08 字数 118 浏览 3 评论 0原文

我正在尝试在使用 Qt 4 时对 URL 进行编码。看起来在 Qt 3 中,方法是 QUrl::encode ,但显然 QUrl 是从 Qt 3 重写的到 Qt 4。我查看了文档,没有看到任何等效的方法。我有什么遗漏的吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南冥有猫 2024-09-16 04:48:08

还可以使用 QUrl::toPercentEncoding 对任何 QString 进行编码而不形成它到一个 URL。

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

肥爪爪 2024-09-16 04:48:08

您需要 QUrl::setEncodedUrlQUrl::toEncoded

You want QUrl::setEncodedUrl and QUrl::toEncoded

煞人兵器 2024-09-16 04:48:08

QUrl 的 Qt3 支持成员指向 Stephen Chu 的答案。只是添加了链接,因为它可能有用..

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文