Lost keyboard control when embedding application into QApplication
-
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?
-
Maybe in the keyEvent call explicitly the notepad keypressed event?
-
Didn't get that...
what do you mean exactly?