Can't receive key and mouse-wheel events after QWidget::createWindowContainer()


  • Moderators

    Hi all,

    I'm on Windows 8.1 x64. I got the HWND of an external program (Notepad.exe, in this case) and embedded it inside a QWidget:

    // Get the HWND using Windows API
    WId id = (WId)FindWindow(NULL, L"Untitled - Notepad");
    
    // Embed the window in a widget
    QWindow* window = QWindow::fromWinId(id);
    QWidget* widget = QWidget::createWindowContainer(window);
    widget->show();
    

    The embedded Notepad can receive mouse clicks and drags (I can use the right-click menu to copy and paste text). But unfortunately, it doesn't respond to mouse wheels and key presses. Does anyone know how I can restore those events?

    Thanks in advance!



  • Hi JKSH,

    Unfortunately your topic is quite old, but there are still no answers available. Have you solved the problem in the meantime? I have exactly the same problem using QWindow::fromWinId and QWidget::createWindowContainer. Mouse clicks and drag are working but no chance to get the mouse wheel interaction. Any idea?

    Thanks in advance!


  • Moderators

    @leipi said:

    Hi JKSH,

    Unfortunately your topic is quite old, but there are still no answers available. Have you solved the problem in the meantime? I have exactly the same problem using QWindow::fromWinId and QWidget::createWindowContainer. Mouse clicks and drag are working but no chance to get the mouse wheel interaction. Any idea?

    Thanks in advance!

    Hi @leipi,

    I ended up abandoning my original effort. As far as I know, this issue has not been resolved unfortunately. See https://bugreports.qt.io/browse/QTBUG-40320


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.