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

Html tables rendered with QTextTable or QTextDocument doesn't respect the layout/text direction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.12
    • GUI: Text handling
    • None

    Description

      Create QTextEdit.

      Paste this html code to it:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
      <html><head></head>
      <body dir="rtl">
        <table border="1">
          <tr>
            <td>ab cd</td>
            <td>ef gh</td>
          </tr>
          <tr>
            <td>ij kl</td>
            <td>mn op</td>
          </tr>
        </table>
      </body></html>
      

      The table cells are RTL, but the table itself is aligned to the right.

      I also tried applying dir="rtl" or style="direction: rtl" to the table tag, but it doesn't help.

      • Same wrong behaviour happens when using QTextCursor::insertTable() method, specifying the QTextTableFormat with layoutDirection attribute set to Qt::RightToLeft.
          • also when drawing the same html code using QTextDocument directly, the RTL direction is not respected.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              anbu Ahmed Bedeer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes