I\'m interested in embedding an external application inside of my QT 5.5 Widget based application. I\'m only concerned with it working on Linux. I\'m using CentOS 7 with GN
The following achieves the desired result, the key was adding the FramelessWindowHint:
QWindow *window = QWindow::fromWinId(211812356);
window->setFlags(Qt::FramelessWindowHint);
QWidget *widget = QWidget::createWindowContainer(window);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(widget);
this->setLayout(layout);
You should have a look at this code: https://github.com/qtproject/qt-solutions/tree/master/qtwinmigrate/src
It was designed to embed non-QT windows into a QWidget on Windows. But there may be some tricks you can pickup from here, like attributes they set to make the windows be nicely integrated with each other.
For instance, you may try this (from qwinwidget.cpp):
QEvent e(QEvent::EmbeddingControl);
QApplication::sendEvent(widget, &e);
If it does not help, check qwinwidget.cpp and qwinhost.cpp for other options.