代码语言:javascript复制下列代码例子中实现的将窗体名字为
Example
的窗体嵌入到QWidget中。
#include <QApplication>
#include <QWindow>
#include <QWidget>
#include <windows.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
WId winId = (WId)FindWindow(NULL, L"Example");
QWindow *window = QWindow::fromWinId(winId);
QWidget *widget = QWidget::createWindowContainer(window);
widget->show();
return a.exec();
}