Read the xml file with Qt, and the program runs to if (! Doc. setContent (& file) error, xmldoc. setcontent
Look at hoyafei's <Qt Creator Quick Start>, and then read the xml file using the example of writing the DOM.
At first, everyone thought that there was a problem with their path. In fact, there was no problem with the open before. How could this problem happen later? (I made a lot of turns here)
To understand the principles of this function in other ways, you can create a tree and save the data in xml format to a doc with the same tree structure. That is to say, we encountered an error when creating this tree. After locating the tree, we can see if our XML file is wrong.
For another xml file, click it online and compare it to find the original line <? Xml version = "1.0" encoding = "UTF-8"?> There cannot be spaces on either side of the question mark!