[Webkit-unassigned] [Bug 28862] [Qt][API] Add a new QGraphicsWidget based version of the "QWebView"

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 9 05:58:39 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=28862


Simon Hausmann <hausmann at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #39260|review?                     |review+
               Flag|                            |




--- Comment #34 from Simon Hausmann <hausmann at webkit.org>  2009-09-09 05:58:38 PDT ---
(From update of attachment 39260)
r=me, this is a good start!

More comments below of stuff that should be fixed in follow-up patches:

> +protected:
> +    virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
> +    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
> +    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
> +    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
> +    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*);
> +    virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
> +#ifndef QT_NO_WHEELEVENT
> +    virtual void wheelEvent(QGraphicsSceneWheelEvent*);
> +#endif
> +    virtual void keyPressEvent(QKeyEvent*);
> +    virtual void keyReleaseEvent(QKeyEvent*);
> +#ifndef QT_NO_CONTEXTMENU
> +    virtual void contextMenuEvent(QContextMenuEvent*);
> +#endif
> +    virtual void dragEnterEvent(QGraphicsSceneDragDropEvent*);
> +    virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent*);
> +    virtual void dragMoveEvent(QGraphicsSceneDragDropEvent*);
> +    virtual void dropEvent(QGraphicsSceneDragDropEvent*);
> +    virtual void focusInEvent(QFocusEvent*);
> +    virtual void focusOutEvent(QFocusEvent*);
> +    virtual void inputMethodEvent(QInputMethodEvent*);
> +    virtual bool focusNextPrevChild(bool next);

Please also re-implement QGraphicsItem::sceneEvent() as well as
QObject::event(), similar to QWebView.
That allows fixing event-related bugs in patch releases without the need to
re-implement an existing
virtual function, which by adding a new symbol cannot be done in patch releases
otherwise.


> +++ b/WebKit/qt/QGVLauncher/main.cpp

This file has a fewcoding style violations in them (* placement for example).
Please fix
before landing.


> @@ -307,8 +308,8 @@ void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, boo
>  {
>      // No double buffer, so only update the QWidget if content changed.
>      if (contentChanged) {
> -        QWidget* view = m_webPage->view();
> -        if (view) {
> +        // Only do implicit paints for QWebView's
> +        if (QWebView* view = qobject_cast<QWebView*>(m_webPage->view())) {
>              QRect rect(windowRect);
>              rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize()));
>              if (!rect.isEmpty())
> @@ -323,8 +324,8 @@ void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, boo
>  
>  void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect&)
>  {
> -    QWidget* view = m_webPage->view();
> -    if (view)
> +    // Only do implicit paints for QWebView's
> +    if (QWebView* view = qobject_cast<QWebView*>(m_webPage->view()))
>          view->scroll(delta.width(), delta.height(), scrollViewRect);
>      emit m_webPage->scrollRequested(delta.width(), delta.height(), scrollViewRect);
>  }

I really hope that we can eliminate these casts in the future, for example by
making
QWebGraphicsItem not call setView() but instead simply keep the widget from the
events
around but not using it in the above methods.



I hoi

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list