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

QTextBrowser toPlainText() output contains HEX chars in place of images

    XMLWordPrintable

Details

    Description

      Attached is code to reproduce the issue. When printed to QLabel etc. the chars are not visible, but when printed for example to file hex characters can be seen.

      #include <QFile>
      #include <QApplication>
      #include <QTextBrowser>
      #include <QTextStream>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QTextBrowser *textBrowser = new QTextBrowser();
          textBrowser->setGeometry(QRect(50, 50, 531, 521));
          textBrowser->setSource(QUrl("qrc:/testHtml.html"));
      
          QFile f("output.txt");
          if(f.open(QIODevice::WriteOnly)) {
              QTextStream out(&f);
              out << textBrowser->toPlainText();
          }
          textBrowser->show();
          return a.exec();
      }
      

      Attachments

        1. output_windows.txt
          0.0 kB
        2. QTBUG-44538.zip
          4 kB
        For Gerrit Dashboard: QTBUG-44538
        # Subject Branch Project Status CR V

        Activity

          People

            ritt.ks Konstantin Ritt
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes