代码
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?我将如何编写这段代码、?谢谢!!!