I wrote a Qt widget application. In the file menu I want to insert an MS word document as a user manual. Is there any way to do it? I checked Qt help and various blogs but none of them gave me a clear solution.
How to attach MS word document in Qt GUI application?
2.4k views Asked by Naveen kumar Katta rathanaiah At
2
There are 2 answers
2

If you want to embed it in your application executable, just insert your .docx file as a resource file. To open the docx file from resources, you should first copy it to some location for example in the application directory path :
QFile HelpFile("qrc:/myFile.docx");;
HelpFile.copy(qApp->applicationDirPath().append("/myFile.docx"));
Next you can open it by :
QDesktopServices::openUrl(QUrl::fromLocalFile(qApp->applicationDirPath().append("/myFile.docx")));
If it is only manual then it is not necessary to embed
MS Word
inside your app. Maybe try to open needed document withWord
installed in computer. Try this code:Just set needed path. As doc said: