Results 1 to 3 of 3

Thread: How to send mouseWheelEvent to SWF, loaded to QWebView

  1. #1
    Join Date
    Jan 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default How to send mouseWheelEvent to SWF, loaded to QWebView

    Good day!

    I have a program, written in C++, using Qt 5.5.1 (can't switch to another version), running under Windows (7 or 10, doesn't matter).

    So I have some FlashWidget, subclassed from QWebView. It loads html file, parses it and replaces %1 with appropriate path to *.swf

    Qt Code:
    1. <object
    2. class="flashPlayer"
    3. width=90%
    4. height=100%
    5. type="application/x-shockwave-flash"
    6. id="bridgemovie"
    7. data="%1" >
    8. <param name="allowScriptAccess" value="always"/>
    9. </object>
    To copy to clipboard, switch view to plain text mode 

    SWF file has event listeners on mouse events: mouse down, up and mouse wheel

    Qt Code:
    1. addEventListener(MouseEvent.MOUSE_WHEEL, zoom); //"zoom" is just some internal function
    2. addEventListener(MouseEvent.MOUSE_DOWN, mouseDown1);
    3. addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
    To copy to clipboard, switch view to plain text mode 

    Problem: Dragging and clicking works pretty well, but loaded SWF doesn't receive wheel events. I can't modify SWF code, only C++ and HTML parts. So, how I can natively pass mouseWheel event from JS (or, perhaps, QWebView, if allowed so) to the loaded SWF file?
    P.S. I've tried loading SWF with QAxWidget, and wheelEvent is received, but there are some rendering problems, so I'm trying to repair solution with QWebView.

  2. #2
    Join Date
    Jan 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to send mouseWheelEvent to SWF, loaded to QWebView

    Well, it looks like a bug in QWebkit, because there is no such problem in newer versions and QWebEngine. Will try use QAxWidget instead.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to send mouseWheelEvent to SWF, loaded to QWebView

    There are also some developers working on updating QtWebKit https://github.com/annulen/webkit/wiki

    Cheers,
    _

Similar Threads

  1. Replies: 8
    Last Post: 3rd September 2013, 10:51
  2. Replies: 4
    Last Post: 27th January 2013, 18:00
  3. How to send a "Ctrl+V" event to a QWebView
    By daudiam in forum Qt Programming
    Replies: 2
    Last Post: 1st December 2010, 10:51
  4. Replies: 1
    Last Post: 24th April 2010, 04:43
  5. Driver not loaded
    By rogerio in forum Installation and Deployment
    Replies: 8
    Last Post: 16th May 2009, 08:07

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.