Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.1, 6.8.3, 6.9.0
-
None
Description
This change for QTBUG-125763 (732962d604e7469f9a9f02fe0cd3d1fd04caddb8, appears in Qt 6.7.1) breaks the intended and documented behavior of the table cell border rendering (QTBUG-36152):
https://doc.qt.io/qt-6/qtexttableformat.html#setBorderCollapse
"Setting the border property to a minimum value of 1 will render a one pixel solid inner table grid using the borderBrush property and an outer border as specified"
The regression is caused by the logic now expecting at least one of the four "border" properties to be set in the cell's format.
+ bool cellBorderConfigured = (cell.format().hasProperty(QTextFormat::TableCellLeftBorder) ||
+ cell.format().hasProperty(QTextFormat::TableCellTopBorder) ||
+ cell.format().hasProperty(QTextFormat::TableCellRightBorder) ||
+ cell.format().hasProperty(QTextFormat::TableCellBottomBorder));
...
- drawTableCellBorder(cellRect, painter, table, td, cell);
+ if (cellBorderConfigured)
+ drawTableCellBorder(cellRect, painter, table, td, cell);
Reproduced by:
QTextDocument *doc = document(); doc->clear(); QTextCursor c(doc); c.insertText("Foo"); QTextTable *table = c.insertTable(10, 10); QTextTableFormat f; f.setBorderCollapse(true); f.setBorder(1); f.setWidth(200); table->setFormat(f); QTextTableCell cell = table->cellAt(5, 5); QTextTableCellFormat cf; cf.setLeftBorder(2); cf.setLeftBorderBrush(Qt::green); cf.setLeftBorderStyle(QTextFrameFormat::BorderStyle_Solid); cell.setFormat(cf);
A complete reproducer is attached.
tests/manual/qtexttableborders does also shows different results when build against Qt 6.7.0 and 6.7.1.
Attachments
Issue Links
- resulted from
-
QTBUG-123167 QTextBrowser.toHtml is not rendering supported CSS border property for html table tag.
-
- Closed
-