×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    Tunisia
    Posts
    81

    Exclamation QtWebKit: why the links do not open?

    Hi,
    Please someone know why facebook links can no be opened in QtWebKit (Symbian Belle Devices)? if you click on facebook link nothing happens!

    This is the simplified code that I'm using:


    Code:
    #include <QtGui/QApplication>
    #include <QtWebKit>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QWebView *webView = new QWebView();
        QWebPage *webPage = new QWebPage(webView);
        webPage->setPreferredContentsSize(QSize(360, 640));
        webPage->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
        webPage->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
        webPage->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
        webPage->currentFrame()->setUrl(QUrl("http://m.facebook.com"));
        webView->setPage(webPage);
        webView->setContextMenuPolicy(Qt::DefaultContextMenu);
    
    
        webView->showFullScreen();
        return app.exec();
    }
    links for other websites can be opened without problem, for example if you change facebook.com by google.com the links provided by google works without any problem.
    Last edited by aymen_ka; 2013-12-03 at 16:38.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    Tunisia
    Posts
    81

    Re: QtWebKit: why the links do not open?

    Update: Now I know the cause of this issue: when you click on facebook link, facebook try to open the link in new window, but my app doesn't handle multiple windows.

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    602

    Re: QtWebKit: why the links do not open?

    Hi Aymen_ka,
    the reason it tries to open the links is because the <a> tag has the target set to _blank or something like that, if you remove the target attribute from the <a> tag it will open within the same webview windows.
    Heard of DVLUP? Join here

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    Tunisia
    Posts
    81

    Re: QtWebKit: why the links do not open?

    Hi shai.i,
    Thanks for the workaround

Similar Threads

  1. SOS qml webview doesnt open links
    By shaii in forum [Archived] Qt Quick
    Replies: 10
    Last Post: 2011-12-28, 00:05
  2. https links load slower than normal links...
    By irene1986 in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2011-05-05, 10:38
  3. S60 3rd Edition - Default browser to open WAP Push links
    By SwordAngel in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2008-03-27, 05:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •