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

[REG: 5->6] QDomDocument::setContent now requires QIODevice to be open

    XMLWordPrintable

Details

    • a4ce85f356b78401fe727a07b908a1e7b5a25198 (qt/qtbase/dev) f7227a7fcabfe17260ccbb6610b1a105844c341f (qt/qtbase/6.2)

    Description

      QDomDocument::setContent opened the QIODevice by itself, but same does not appear to be true in Qt 6. For example:

      QFile file("some.xml");
      QDomdocument doc;
      doc.setContent(&file);
      

      in Qt 5 all works fine, in Qt 6 it prints a message that the device is not open and naturally the loading fails.

      The documentation did not say if it can do that or if it has to be open, so maybe it is not really a bug, but a note could be added here at least:

      https://doc.qt.io/qt-6/xml-changes-qt6.html

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sonakur Sona Kurazyan
            poikelin Joni Poikelin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes