gpt4 book ai didi

c++ - 如何在 Qt GUI 应用程序中附加 MS word 文档?

转载 作者:行者123 更新时间:2023-11-27 23:01:09 24 4
gpt4 key购买 nike

我写了一个 Qt 小部件应用程序。在文件菜单中,我想插入一个 MS word 文档作为用户手册。有什么办法吗?我检查了 Qt 帮助和各种博客,但没有一个给我明确的解决方案。

最佳答案

如果只是手动操作,则无需在您的应用中嵌入 MS Word。也许尝试用计算机上安装的 Word 打开需要的文档。试试这个代码:

QDesktopServices::openUrl(QUrl("file:///G:/tst.docx"));

只需设置需要的路径。 As doc said:

If the URL is a reference to a local file (i.e., the URL scheme is "file") then it will be opened with a suitable application instead of a Web browser.

关于c++ - 如何在 Qt GUI 应用程序中附加 MS word 文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27566361/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com