Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-17321

QString cannot be set to the value returned by QXmlStreamReader::readElementText()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.7.1
    • None
    • Ubuntu 10.17; gcc 4.4.1; qmake 2.01a; qt 4.7.1 compiled without QWebKit

    Description

      When a valid xml document is parsed by QXmlStreamReader, the readElementText() function will return a QString that can be interpreted by qDebug() but can be set to a QString variable. In the attached code, I created variables named QString a, QString b, and QString c. I set 'a' = "String A", and I set 'b' = 'a'. As expected, "qDebug() << a" prints "String A". I then set 'c' to "String C." Finally, I parse a valid xml document for an xml element <bug> and display the results with qDebug(). Afterwich, I attempt to set 'c' to xml.readElementText() and display the empty result with qDebug().

      Attachments

        1. example.xex
          0.1 kB
        2. main.cpp
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            earthdomain Earth Domain (Inactive)
            bonker2121 Charles Allen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes