Quantcast
Channel: Qt DevNet forums: Qt WebKit
Viewing all articles
Browse latest Browse all 542

Force URL in QWebView

$
0
0
Hi, I’d like to force domain loaded in QWebView. i.e. if the url doesn’t start by “http(s)://www.domain.xxx”, => then abort and load “http(s)://www.domain.xxx” For example, I tryed like this: connect(view, SIGNAL(urlChanged(QUrl)), SLOT(forceDomain()));   // ...   void MainWindow::forceDomain() {     QString loc = view->url().toString();     if ( !loc.startsWith("http://www.domain.xxx") )     {         QUrl url = QUrl("http://www.domain.xxx");         view->load(url);         view->setFocus();      } } But it seems the code is looping (?) The application fail with code “1073741819” Any suggestion? Thx, Cedric

Viewing all articles
Browse latest Browse all 542

Trending Articles