How to embed external program in main window.
I am using qt creator and i want to embed the external program in main window. I created the codes but if i click push button for external program, then the ui is closed and it says "External WM_DESTROY received for QWidgetWindow(0x1fd65538, name="MainWindowWindow") , parent: QWindow(0x0) , transient parent: QWindow(0x0)". Can anyone help me to figure it out?
This is my code.
void MainWindow::on_pushButton_8_clicked()
{
QString program = "D:\\my program name.exe";
QProcess *wicdProgram;
wicdProgram = new QProcess(this);
wicdProgram->setProgram(program);
WId id = QWidget::winId();
QWindow *window = QWindow::fromWinId(id);
window->setFlags(Qt::FramelessWindowHint);
window->show();
QWidget *widget = QWidget::createWindowContainer(window)
widget->show();
setCentralWidget(widget);
ui->gridLayout->addWidget(widget);
wicdProgram->start();
Re: How to embed external program in main window.
Quote:
Originally Posted by
hajh90
...
WId id = QWidget::winId();
...
This does not look correct to me. I would think you need the Id of you wicdProgram, but that line gets the Id of your MainWindow.
Ginsengelf
Re: How to embed external program in main window.
Quote:
Originally Posted by
Ginsengelf
This does not look correct to me. I would think you need the Id of you wicdProgram, but that line gets the Id of your MainWindow.
Ginsengelf
Thank you for reply. Then how can i get the right id?
Re: How to embed external program in main window.
Quote:
Originally Posted by
hajh90
Thank you for reply. Then how can i get the right id?
User shame already answered that in the other thread you posted.
Cheers,
_