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. Lost keyboard control when embedding application into QApplication
Forum Updated to NodeBB v4.3 + New Features

Lost keyboard control when embedding application into QApplication

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

    I'm using Qt 5.2 and trying to embed notepad.exe into a widget in my QApplication. my code is:

    @ HWND winHandle = ::FindWindowA(NULL, "Untitled - Notepad");
    if(winHandle != NULL)
    {
    QWindow * window = QWindow::fromWinId((WId) winHandle);
    QWidget * notepadWidget = QWidget::createWindowContainer(window);
    notepadWidget ->setParent( ui->widget);
    QVBoxLayout *layout = new QVBoxLayout();
    layout->addWidget(notepadWidget);
    ui->widget->setLayout(layout);
    }@

    the notepad window is embedded beautifully into my application, but i lost the keyboard control!! I cannot type inside notepad. The mouse is working properly(i can select text, etc.) anyone?

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Maybe in the keyEvent call explicitly the notepad keypressed event?

      Greetz, Jeroen

      1 Reply Last reply
      0
      • O Offline
        O Offline
        one-one
        wrote on last edited by
        #3

        Didn't get that...
        what do you mean exactly?

        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