QT 5.5 embed external application into QWidget

前端 未结 2 417
逝去的感伤
逝去的感伤 2020-12-14 04:37

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

2条回答
  •  不思量自难忘°
    2020-12-14 05:19

    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);
    

提交回复
热议问题