QWebView 的 url 更改时不会通知我
我有一个 QWebView 并设置其内容,
setHtml( "html-code-here", QUrl( "file:///place/where/some/resources/are");
我在网站上放置了一个提交按钮以将表单发送到 action=""。 但小部件不再发出 urlChanged(QUrl)
。
实际上,这是因为我将 "file://"
放在 url 开头之前。 在前面加上“file://”,它可以很好地加载所有图像,但当我单击提交按钮时,它不会发出 urlChanged()
信号。 如果我跳过 "file://"
它不会加载资源,但会按预期发出 urlChanged()
。
我怎样才能同时实现加载图像+更改网址时收到通知?
I have a QWebView
and set its content with
setHtml( "html-code-here", QUrl( "file:///place/where/some/resources/are");
I placed a submit button on the website to send a form to action="".
but the widget isn't emitting the urlChanged(QUrl)
anymore.
Actually this happens since I put "file://"
before the beginning of the url.
With the "file://"
prepended it loads all images just fine, but it does not emit the urlChanged()
signal when I click the submit button.
If I skip the "file://"
it doesn't load the resources, but emits the urlChanged()
as expected.
How can I achieve both, loading images + get notified when changing the url?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论