Skip to content
  • 0 Votes
    3 Posts
    1k Views
    I

    Thank You. That looks like it might be what I need. If not, it may help get me there.

    I will test it as soon as I can. I am having problems with Qt Creator. I just updated to 9.0.0 and now Qt Creator crashes/closes as soon as I try to go to the designer.

    I just posted this issue.

  • 0 Votes
    4 Posts
    338 Views
    J

    Its working now, due to main.cpp it didn't work. Thanks a lot. can I place those speed values in lineseries chart instead of Listview can i take lineseries chart

  • 0 Votes
    3 Posts
    1k Views
    P

    Hi,
    Creating a very "abstract" xml parser is not easy and it's quite error-prone. You have to know some (or at least one) parent or common tag names in order to have a starting point for any deeper "abstract" parsing. Basically, you have to move the parser step by step checking everything in the way. For example, you could use a simple function as an entry point for the following function when you meet a specific tag:

    void XmlReader::readFragment() { Q_ASSERT(m_reader->isStartElement()); //Make sure the xmlreader is at an opening tag const QString p = m_reader->qualifiedName().toString(); // From now on, you will work with this opening tag //Do what you want, for example handle attributes and their values for (auto i = 0; i < m_reader->attributes().count(); ++i) { ... } m_reader->readNext(); //Move on ... //Do everything manually like this if (m_reader->isCharacters) { ... } else if (m_reader->isEndElement()) { ... } //or like this //Eventually, you have to check for the closing current tag, exit the function, //and return the control to the "entry point" function while (!m_reader->isEndElement() && !m_reader->qualifiedName().toString() == p) { ... //Do your work m_reader->readNext(); } }

    However, with this approach, things can get extremely complicated if there are nested tags, for example:

    <p> <note> <p>...</p> </note> </p>

    Maybe it would be easier to subclass QXmlStreamReader but it would help to provide some sample xml data and more info on what exactly you want to do.

  • 0 Votes
    3 Posts
    2k Views
    bguivarchB

    Hello,

    From the status value (which was either 1 or 2), I supposed that it had no problem findind the file.
    I solved the issue by myself, the header of my XML file was missing a double quote in the version value.
    Now it is working.

    Regards,

  • 0 Votes
    1 Posts
    951 Views
    No one has replied