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

Background color for QTextCharFormat

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 4.7.4
    • GUI: Text handling
    • None
    • Windows

    Description

      When a QTextTable is created to a QTextDocument and the background color is set with QTextCharFormat, an ODF file is created and the background color is used as the highlight color for the text. The background color for the table is not set. If an html file is created the background color is set for the table cell. The following example will show the issue:

      int main(int argc, char *argv[])
      {
      	QApplication app(argc, argv);
      
      	QTextDocument doc;
      	QTextTableFormat formatTable;
              QTextCursor cursor(&doc);
      	formatTable.setCellPadding(10.0);
      	QTextTable * pTable = cursor.insertTable(1,1,formatTable);
              QTextTableCell cell = pTable->cellAt(0,0);
      	QTextCharFormat format = cell.format(); 
              format.setBackground(Qt::blue);
      	cell.setFormat(format);
              cursor.insertText("hello");
      	QTextDocumentWriter("test.odt","odf").write(&doc);
              QTextDocumentWriter("test.html","html").write(&doc);
      
              return 0;
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              qtcomsupport Qt Support
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes