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

QTextBrowser does not support anchors on table rows

XMLWordPrintable

      When trying to display a Qt documentation page inside a QTextBrowser, jumping to property definitions does not work, as the QTextBrowser does not support "id='row'" on <tr>.

          QTextBrowser *browser = new QTextBrowser;    browser->setHtml(R"rhtml(
      <!DOCTYPE html>
      <html lang="en">
      <body>
          <table>
              <tr id="row1">
                  <td id="row1-col1">Row 1 Col 1</td>
              </tr>
          </table>
      </body>
      </html>
      )rhtml");    
      
      for (QTextBlock block = browser->document()->begin(); block.isValid(); block = block.next()) {
              QTextCharFormat format = block.charFormat();
              if (format.isAnchor()) {
                  qDebug() << format.anchorNames();
              }
          } 

      I would expect "row1" to be printed, but only "row1-col1" is printed.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            madwinter Marcus Tillmanns
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes