QT How to embed an application into QT widget

后端 未结 2 1692
逝去的感伤
逝去的感伤 2020-12-14 23:34

In our project we have three independent applications, and we have to develop a QT control application that controls these three applications. The main window will be sepera

2条回答
  •  旧时难觅i
    2020-12-14 23:54

    I never tried it myself, but from the docs in Qt 5.1 I would try QWindow::fromId(WId id), which gives you a QWindow, which should be embeddable with createWindowContainer:

    QWindow * QWindow::fromWinId(WId id) [static] Creates a local representation of a window created by another process or by using native libraries below Qt.

    Given the handle id to a native window, this method creates a QWindow object which can be used to represent the window when invoking methods like setParent() and setTransientParent(). This can be used, on platforms which support it, to embed a window inside a container or to make a window stick on top of a window created by another process.

    But no guarantee. :-)

提交回复
热议问题