Bug 45871 - [Qt] Refactor the ownership and lifetime of some objects in QtTestBrowser current design
Summary: [Qt] Refactor the ownership and lifetime of some objects in QtTestBrowser cur...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Antonio Gomes
URL:
Keywords:
Depends on:
Blocks: 43768
  Show dependency treegraph
 
Reported: 2010-09-15 21:44 PDT by Antonio Gomes
Modified: 2012-05-01 07:24 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Gomes 2010-09-15 21:44:40 PDT
Follows the life-time of some core objects in the current QtTestBrowser design:

- WebPage class: It is created and destroyed by the MainWindow constructor and destructor (MainWindow object is the parent of WebPage)

- The QGraphicsScene object is created and owned by corresponding WebViewGraphicsBased (derived of QGraphicsView), which by design is wrong since it is one scene can have multiples view, and not the other way around.

I propose:

1) Changing WebPage to not be owned by the MainWindow. Instead making it refcount'ed by inheriting QSharedData (and using QExplicitlySharedDataPoint).

2) Making the QGraphicsScene object also independent from the WebViewGraphicsBased ownership-wise, and also ref-counted.

That way features like DEVELOPER->GRAPHICS VIEW->CLONE WINDOW would work fine - see bug 43768.

The main point here is: when user CLONE a window, both QGraphicsScene object and QWebPage has to be the same for both view.

I have a patch that these change working fine, however need clean up. I will upload it soon.