4

Apologies if this question is grounded in misconception. I'm new to both webkit and Qt.

I'm trying to get a feel for what circumstances would justify using a QGraphicsWebView instead of a simple QWebView object. I understand one is more complicated to implement than the other. What added fliexibility does use of the QGraphicsView class add? And why does Qt-Creator's default HTML5 application template use a QGraphicsWebView instead of a QWebView?

For example, if I wanted to implement mouse gesture-driven scrolling and zooming, or implement a custom scrolling implementation, would I need a QGraphicsWebView, or would a simple QWebView suffice?

  • 3
    [*QWebView is based on the QWidget system, thus it cannot easily support rotation, overlays, hardware accelerated compositing and tiling*](http://trac.webkit.org/wiki/QtWebKitTiling). – thuga Oct 17 '14 at 13:09

1 Answers1

2

From Qt docs:

The QGraphicsWebView class allows Web content to be added to a GraphicsView

So QGraphicsWebView can be used as QGraphicsItem in the QGraphicsScene.

GreenScape
  • 7,191
  • 2
  • 34
  • 64
  • I got that far. But what are the advantages of doing it that way? – Username Obfuscation Oct 17 '14 at 12:46
  • No other advantages. The only difference between `QGraphicsWebView` and `QWebView` is their parent `Widget`. For `QGraphicsWebView` it's `QGraphicsWidget`, which gives you ability to add it to scene. And for `QWebView` it's just common `QWidget`. – GreenScape Oct 17 '14 at 12:51