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

QTextDocument does not support nested HTML blocks

    XMLWordPrintable

Details

    Description

      QTextDocument does not support nested HTML blocks

      The inner block's formatting is not respected.

      #include <QtGui>
      
      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);
      QString html_sequence = QString(" \
      <html> \
      <head> \
      <style type=text/css> \
      body { background: #ffffff; color: black; } \
      .title { background: #f0f0f0; align: center; } \
      .subtitle { font-size: 8px; color: red;} \
      .small-subtitle { font-size: 6px; color: blue; } \
      </style> \
      </head> \
      \
      <body> \
      <h1 class=title>Title without subtitle<br /></h1> \
      <h1 class=title>Title with subtitle<br /><span class=subtitle>This is the subtitle</span></h1> \
      <h1 class=title>Title with small subtitle<br /><span class=small-subtitle>This is the small subtitle</span></h1> \
      </body> \
      </html> \
      ");
      
      QTextEdit test(html_sequence);
      test.show();
      return app.exec();
      }
      

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            roschern Nils Christian Roscher-Nielsen (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes