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. Can't receive key and mouse-wheel events after QWidget::createWindowContainer()

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.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.
  • JKSHJ Offline
    JKSHJ Offline
    JKSH
    Moderators
    wrote on last edited by JKSH
    #1

    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!

    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

    1 Reply Last reply
    0
    • leipiL Offline
      leipiL Offline
      leipi
      wrote on last edited by leipi
      #2

      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!

      JKSHJ 1 Reply Last reply
      0
      • leipiL leipi

        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!

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @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

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        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