Hello
I'm new to programming, and this is my first Qt app.
I'm trying to download an XML file, and then parse it. The problem is that while downloading the XML, and waiting for the finished() signal, it begins parsing - but that means it's parsing nothing at all.
I need the XML to save first, and then the app opens it, and then it parses.
//creating new xmlReader
xml = new xmlReader(externalSettings);
//creating new xmlReader
xml = new xmlReader(externalSettings);
To copy to clipboard, switch view to plain text mode
The above is initialising a pointer to the xmlReader which downloads the XML file, and saves it. It's an overloaded constructor and 'externalSettings' is the URL of the XML file.
//getting number of images from the XML file
int numberOfImages = xml->getNumImages();
//getting number of images from the XML file
int numberOfImages = xml->getNumImages();
To copy to clipboard, switch view to plain text mode
Once the XML file is downloaded, this function should get data from the downloaded XML file. But it does so before it is downloaded.
The second time I run the program, everything is fine, but that's because the XML file was downloaded during the first run.
I hope I'm being clear. My code is probably ugly, but I hope to get used to good programming practices soon.
Thank you
Bookmarks