2

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! i cannot type inside notepad. the mouse is working properly(i can select text, etc.) anyone?

UmNyobe
  • 22,539
  • 9
  • 61
  • 90
one
  • 511
  • 5
  • 17

0 Answers0