qwebview,如何确定此链接是否为新窗口
QWebView,How to determine whether this link is a new window?
代码
News::News(QWidget *parent) :
QDialog(parent),
ui(new Ui::News)
{
ui->setupUi(this);
ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(ui->webView,SIGNAL(linkClicked(QUrl)),this,SLOT(openUrl(QUrl)));
}
void News::openUrl(QUrl url){
if(the new window)
QDesktopServices::openUrl(url);
}else{
ui->webView->load(url);
}
}
如何判断而不是新的窗口链接函数OpenUrl?我将如何编写此代码,?谢谢!!!
您需要从qwebview继承自己的类,然后重新进来createwindow()方法。http://doc.qt.digia.com/qt/qwebview.html#createwindow
相关文章:
- 如何使用Qt在新窗口中显示视频帧
- Qt5 C++将新窗口与Qt设计器链接
- 在SFML(C++)中启动一个新窗口
- Qt将鼠标移动事件转移到新窗口
- 如何在窗口上设置使用 CreateProcess 创建的新进程的主线程的堆栈大小?
- 主窗口的新方法不可见
- 在Clion的新窗口中创建一个新项目
- Visual C 关闭文本文件和打开新的控制台窗口
- 有没有办法为使用 Boost 生成的进程创建新的控制台窗口
- 如何在Qt中打开新窗口的情况下更改UI?
- 子类别窗口窗口
- 朱奇 - 制作一个新窗口
- 设置 VLC drawable-hwnd 仍会创建一个新窗口
- 运行 SFML 图形后看不到新窗口
- 最佳地将窗口标题替换为新的 QString
- 如何在Mac上打开Carbon中的C++新窗口
- 创建一个没有父级的新Qt窗口是否也会创建一个新线程
- 获取确切的窗口区域大小 - 创建窗口窗口大小不正确
- 打开一个带有插槽的新Qt窗口
- 我如何复制一个窗口的可视内容,并把它放在一个新的窗口在win32c++