Bug 45871

Summary: [Qt] Refactor the ownership and lifetime of some objects in QtTestBrowser current design
Product: WebKit Reporter: Antonio Gomes <tonikitoo>
Component: Tools / TestsAssignee: Antonio Gomes <tonikitoo>
Status: RESOLVED WONTFIX    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 43768    

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.