Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to send mouse events to the embedded flash player in QAxWidget
Forum Updated to NodeBB v4.3 + New Features

How to send mouse events to the embedded flash player in QAxWidget

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 791 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    sevketcaba
    wrote on last edited by
    #1

    I have a QAxWidget which embeds a flash player and loads a swf. I don't want to use the widget, but instead i want to render the widget into a QImage, and then, use that image as a texture in my OpenSceneGraph node. Everything is ok, so far. But since there is no widget visible, i have to get the mouse move/press/release events from my osgView, calculate the corresponding position to my node, and send the events to the flash player to make actionscript mouse events work. The calculation part is tomorrow's problem. But up to now, i was not able to send any custom mouse event to the player. Does anyone have any opinion?

    Here is the example code,
    @
    BFlashWidget::BFlashWidget(QWidget *parent)
    : QAxWidget(parent)
    {
    QSize imgSize(800,600);
    setMinimumSize(imgSize);

    setMouseTracking(true);
    
    mQtImg = QImage(imgSize, QImage::Format_RGBA8888);
    
    setControl(QString::fromUtf8("{d27cdb6e-ae6d-11cf-96b8-444553540000}"));
    dynamicCall("LoadMovie(long, string)", 0,
                QDir::currentPath() + "//deneme.swf");
    activateWindow();
    

    }

    BFlashWidget::~BFlashWidget()
    {

    }

    QImage BFlashWidget::getImage()
    {
    QPainter painter(&mQtImg);
    render(&painter);

    return mQtImg;
    

    }

    void BFlashWidget::simulateMouseMove(QMouseEvent *e)
    {
    QApplication::sendEvent(this, e);
    QApplication::processEvents();
    }

    void BFlashWidget::simulateMousePress(QMouseEvent *e)
    {
    QApplication::sendEvent(this, e);
    QApplication::processEvents();
    }

    void BFlashWidget::simulateMouseRelease(QMouseEvent *e)
    {
    QApplication::sendEvent(this, e);
    QApplication::processEvents();
    }
    @
    player does nothing when i call those simulateMouseXXXXX methods

    And i call simulateMouseXXXXX methods from a QGLWidget which i embedded the osgViewer::CompositeViewer in, with the QMouseEvent arguments of itself.

    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