From 2dd3637c80a580490c0ea3c1388b920d5f74e791 Mon Sep 17 00:00:00 2001 From: Santhosh Kumar Date: Wed, 4 Jun 2025 12:33:30 +0200 Subject: [PATCH] Fix regression in drawing table cell border when border-collapse enabled The patch 732962d604e7469f9a9f02fe0cd3d1fd04caddb8 enables drawing a border around cells within the table when set through CSS styling. But this caused a regression when border-collapse is enabled without setting the cell border. This patch enables drawing borders for table cells when either of those conditions is satisfied. Fixes: QTBUG-136590 Pick-to: 6.8 Change-Id: Ibf43c404439c9fee1cfd2b40789150edb76c6971 Reviewed-by: Nils Jeisecke Reviewed-by: Christian Ehrlicher (cherry picked from commit 2e0dc22bdb46f94a516e834ad4fda2b93aada352) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 999dbe5734278cf4df062eea6b640287a4c2f5e7) --- src/gui/text/qtextdocumentlayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index ef91decc9ff..dc05ef0bac3 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -1894,7 +1894,7 @@ void QTextDocumentLayoutPrivate::drawTableCell(const QRectF &cellRect, QPainter } // paint over the background - otherwise we would have to adjust the background paint cellRect for the border values - if (cellBorderConfigured) + if (cellBorderConfigured || (td->borderCollapse && td->border != 0)) drawTableCellBorder(cellRect, painter, table, td, cell); const QFixed verticalOffset = td->cellVerticalOffsets.at(c + r * table->columns());