'Unembedding application from QWidget

Referring to this question. After embedding an external application with the code:

#include <QApplication>
#include<QProcess>
#include<QDesktopServices>
#include<QUrl>
#include<QWindow>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QMainWindow *w = new QMainWindow();
    w->setWindowTitle("Genome Embedded Calculator");
    QWindow* window = QWindow::fromWinId(41943047); // Hardcoded Window Id for Genome Calculator
    window->setFlags(Qt::FramelessWindowHint);
    QWidget *widget = QWidget::createWindowContainer(window);
    w->setCentralWidget(widget);
    w->show();
    return a.exec();
}

How to detach the QWindow after closing the application? I want the gnome-calculator process to continue working after closing my application.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source