QML 中播放PPT文件

效果:

一,思路 

  • MFC 操作PPT,然年将MFC封装成dll 供Qt使用(https://blog.csdn.net/qq21497936/article/details/95329108)
  • Qt将mfc中的句柄,加载到QWidget中
  • QML 通过 QQuickWidget ,将QWidget 加载到QMl中(https://blog.csdn.net/weixin_38416696/article/details/105432882)

二,细节

  • 采用隐藏方式打开,否则会打开PPT
if (!strFileName.IsEmpty())
	{
		presentations = app.get_Presentations();
		presentation = presentations.Open(strFileName, 0, 0, 0);
		if (presentation == NULL) {
			return NULL;
		}
	}
  • 判断下指针是否为空,否则下一步会崩溃
    void __stdcall OnBnClickedButtonNext() {
    	presentation = app.get_ActivePresentation();
    	if (presentation != NULL) {
    		slideShowWindow = presentation.get_SlideShowWindow();
    		slideShowView = slideShowWindow.get_View();
    		slideShowView.Next();
    	}
    
    }
    

     

你可能感兴趣的:(Qt)