QWebView 自动选项卡
我使用 QWebView.load(QUrl(myurl)) 打开一个网页,该网页获取一些输入并返回一个新的 php 生成的页面。
如果在 Firefox 中执行,浏览器会自动打开一个新选项卡/窗口以显示返回的页面。
如何告诉 QWebView 打开一个新的 QWebview 实例并加载返回的数据?
我正在查看 QwebView 文档 www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwebview.html ...但没有喜悦。
此类页面的示例: http://www.iqfront.com /index.php?option=com_content&view=article&id=5&Itemid=4
感谢您的任何想法。
I open a web page with QWebView.load(QUrl(myurl)) , the webpage gets some input and returns a new php generated page.
If executed in Firefox the browser automatically opens a new tab/window to show the returned page.
How to tell QWebView to open a new instance of QWebview with the returned data loaded?
I was looking at at the QwebView documentation at
www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwebview.html ... but no joy.
Example of such a page :
http://www.iqfront.com/index.php?option=com_content&view=article&id=5&Itemid=4
Thanks for any ideas.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的理解,这是开发人员的工作,为单击的网址创建和打开新选项卡。您需要为 QWebView::linkClicked 信号。每当用户单击链接并且页面的 linkDelegationPolicy 属性设置为委托指定 url 的链接处理时,就会发出此信号。您可以在其中创建 QWebView 的新实例,为其添加选项卡并在其中打开新的 url。下面是一个例子:
希望这有帮助,问候
from my understanding this is developer's job to create and open new tabs for urls clicked.You would need to define a custom slot for QWebView::linkClicked signal. This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy property is set to delegate the link handling for the specified url. There you can create a new instance of QWebView add it a tab and open new url there. Below is an example:
hope this helps, regards