Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. QGraphicsWebView and CSS hover

QGraphicsWebView and CSS hover

Scheduled Pinned Locked Moved Qt WebKit
4 Posts 2 Posters 4.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bunjee
    wrote on 28 Oct 2010, 08:55 last edited by
    #1

    Dear trolls,

    I have a QGraphicsWebView in the middle of a QGraphicsScene.

    I have an "hoverable" / "highligthable" item near the edge of my Web View.

    When I'm on this item and then quit suddenly the Web View the items stays in "CSS hover mode".

    Is there currently a way to avoid that (something like QWebPage::clearCSSHover()) ? Or is it a webkit specific issue ?

    Thanks.

    B.A.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      benjamin.poulain
      wrote on 28 Oct 2010, 12:30 last edited by
      #2

      I can reproduce the issue. Alexis will have a look if he has time.

      If you want to work around it, I think you could send a fake mouse move event QWebPage, with a position outside the viewport (-100, -100).

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bunjee
        wrote on 28 Oct 2010, 16:50 last edited by
        #3

        Thanks Benjamin,

        By "send a fake mouse move event QWebPage" you mean send a fake mouse move event to the QWebPage::view() widget of the QWebPage ?

        Is it handled the same for a QGraphicsWebView ?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bunjee
          wrote on 6 Feb 2011, 15:43 last edited by
          #4

          For the records, here is the workaround:
          @// In my subclassed QGraphicsWebView ...

          class WGraphicsWebView : public QGraphicsWebView
          {
          Q_OBJECT

          public:
          WGraphicsWebView(WDeclarativeWebView * parent = 0);

          private: // Variables
          WDeclarativeWebView * parent;

          private: // Settings
          friend class WDeclarativeWebView;
          };

          // And in my declarative item web view ...

          /* virtual */ void WDeclarativeWebView::hoverLeaveEvent(QGraphicsSceneHoverEvent * event)
          {
          Q_UNUSED(event);

          QGraphicsSceneMouseEvent viewEvent(QEvent::GraphicsSceneMouseMove);
          viewEvent.setPos(QPointF(-100, -100));
          
          webView->mouseMoveEvent(&viewEvent);
          

          }
          @

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved