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.
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.