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 best solutions below
2
Nejat
On
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")));
Related Questions in C++
- C++ using std::vector across boundaries
- Linked list without struct
- Connecting Signal QML to C++ (Qt5)
- how to get the reference of struct soap inherited in C++ Proxy/Service class
- Why we can't assign value to pointer
- Conversion of objects in c++
- shared_ptr: "is not a type" error
- C++ template using pointer and non pointer arguments in a QVector
- C++ SFML 2.2 vectors
- Lifetime of temporary objects
- I want to be able to use 4 different variables in a select statement in c ++
- segmentation fault: 11, extracting data in vector
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- How can I print all the values in this linked list inside a hash table?
- Configured TTL for A record(s) backing CNAME records
Related Questions in QT
- C++ template using pointer and non pointer arguments in a QVector
- Using QPointer and QObject::connect with C++11
- qt How to style a QToolBar > QToolButton overflow button?
- Qt - Repeatedly write at beginning of file
- C++ Mongodb driver, not working
- deletion and cleanup of worker thread in Qt crashes
- How to drap item from QTableView to QPushButton?
- get image type from qimage
- C++ QT Getting part from QString
- How to connect a destroyed signal of C++ object from QML?
- How to get shader version from QOpenGLShader?
- Size of Qt QRadioButton able to get smaller, but not larger than default
- error WinSock.h has already been included Boost Windows Qt
- How to call a non-class member function with pointers as parameters with QtConcurrent::run?
- What is the difference between MinGW SEH and MinGW SJLJ?
Related Questions in MS-WORD
- Cannot open xml file
- How to programatically implement Columns in page layout as of in MS Word using python-docx
- In which field the cursor is? (ms word, vba)
- load word file (.docx) in richtextbox
- Replace hyperlink with text from linked document
- Embedding Image in Microsoft Word using ColdFusion
- Using array in for cycle in Word Interop
- Runtime Error '5941' The Requested Member of Collection Does Not Exist
- Insert a photo to a Word bookmark from an Excel range, VBA
- How to choose a different header image in MS Word 2013 using a macro/button
- Can we edit hyperlink in Restrict editing mode in Word 2013?
- Macro in Word to Underline each paragraph in document less than X characters long
- Need to capture current scroll position (not cursor position) in MS Word
- Apply style on Content Control in a Word Document using OpenXML
- ActiveDocument.Tables.Count returns 0 but there are 4 tables
Related Questions in .DOC
- How to get all text between two Headings from a word Document .doc or .docx in c#
- Convert Database string which is in .DOC format to .DOCX format on the fly
- Create Word file (docx) on Android with Jword Library Apache POI (Solution)
- Use Powershell to find SSN's in Word and Excell Documents
- Insert piece of .doc .docx file to another by using the Apache POI HWPF or XWPF
- How to convert .docx to .doc using apache poi
- creating an emailable or printable document using an Android app
- Display .docx (.doc) on Browser without downloading in php
- How to attach MS word document in Qt GUI application?
- OpenXML converting .docx to .doc
- How do I display a Word document in a rich-edit control?
- getting error for opening MS word doc in IIS 7,
- Save generated .doc file on specific path or send to mail in Laravel
- How do I download Word document attachments from gmail?
- Convert Jupyter notebook into MS word document .doc?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If it is only manual then it is not necessary to embed
MS Wordinside your app. Maybe try to open needed document withWordinstalled in computer. Try this code:Just set needed path. As doc said: