在QFrame中嵌入IE窗口

3

我试图使用QProcess调用IE应用程序,将IE窗口嵌入到一个QFrame中。我在Win7 32位操作系统上使用Qt 5.2.1。

我尝试了以下几种方法:

  • Try to set the parent of the process to be the frame, instead of the MainWindow by this

    QProcess *process = new QProcess(ui->frame_Video);
    

通过这个AND操作

QProcess *process = new QProcess(ui->frame_Video); 
process->setParent(ui->frame_Video);

我尝试使用 QWidget::createWindowContainer() 方法,按照以下工作流程进行:

获取IE窗口的WId(通过IE窗口的hWnd或其他方法) 使用QWindow::fromWinID()创建一个QWindowQWindow传递给QWidget::createWindowContainer()

我的问题:

  1. 是否可以将IE窗口嵌入到Qt应用程序中?
  2. 关于我的第一种方法,如何使QFrame对象成为QProcess的父对象
  3. 第三种方法是否有效?(我仍需要找到如何将hWnd转换为WId的方法)

我认为 QProcess 没有实现任何嵌入功能。它会在你的 Qt 应用程序中运行一个单独的进程(应用程序)。你可以尝试查看 QAxWidget - vahancho
一个应用程序(例如IE)可以作为ActiveX控件对象运行吗? - user3079474
@user3079474 是的,那就是你想要做的事情,而你应该使用activeqt模块来实现。 - Kuba hasn't forgotten Monica
1个回答

3

我的问题的答案

是的,可以在Qt应用程序中嵌入IE窗口(正如@vahancho所指出的),您需要使用QAxWidgets。有关更多详细信息,请参见Examples / Activeqt中的Web浏览器示例。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接