Bug 49215 - [Qt] QWebView::setPage() doesn't disconnect the previous QWebPage
Summary: [Qt] QWebView::setPage() doesn't disconnect the previous QWebPage
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Major
Assignee: Nobody
URL:
Keywords: EasyFix, Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-11-08 15:42 PST by Volker Grabsch
Modified: 2011-02-18 09:36 PST (History)
3 users (show)

See Also:


Attachments
Minimal Qt application to demonstrate the issue (34.60 KB, application/gzip)
2010-11-08 15:42 PST, Volker Grabsch
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Grabsch 2010-11-08 15:42:52 PST
Created attachment 73298 [details]
Minimal Qt application to demonstrate the issue

When the 'page' object of a QWebView is changed, the previous page isn't disconnected from the QWebView:

This leads to all kinds of strange behaviors. For instance, if the previous site showed a bigger image and this the magnifying mouse cursor, switching to a new page that contains HTML doesn't make the cursor change back. Also, the new HTML page doesn't react on clicks anymore. It is as if both pages fight about the user input.

I'm using the following workaround:

    if (webView->page() != 0) {
        webView->page()->setView(0);
    }

    webView->setPage(newWebPage);

That is, I disconnect the old page by hand before setting a new page. However, it would be much better if QWebView::setPage() did that automatically.

I attached a small Qt application to demonstrate the issue. Just click around, on the buttons and into the QWebView. You'll soon notice that neither the HTML page nor the image page won't respond anymore. If you then activate (i.e. uncomment) the workarounds in MainWindow.cpp, everything will run fine.
Comment 1 Gopal Raghavan 2011-01-26 11:53:33 PST
This issue is reproducible with qt-4.8-latest-release also.
I switched the webkit and tried to use trunk webkit r76636. The issue is gone.
--
Gopal
Comment 2 Ademar Reis 2011-02-18 09:36:09 PST
Tested on the following versions:

trunk: not affected
2.1 (branch): not affected
2.0 (qt47): affected

Since trunk is fine, I'm closing the bug. The next version of QtWebKit (2.1) will also be fine. Thanks for reporting it.