-
Bug
-
Resolution: Done
-
P1: Critical
-
5.3.0
-
None
-
b56a42be1476d7b3330968d81329a5e29b5fb819
Make a widget with the following paint event:
void paintEvent(QPaintEvent *)
{
QPainter p(this);
QString s = QString() + QChar(' ') + QChar('a') + QString(10, QChar::Nbsp) + QChar('a') + QChar(' ') + QChar('A');
QString text = s + s + s + s + s + s + s + s + s + s + s + s + s + s ;
QTextLayout layout(text);
layout.beginLayout();
qreal y = 0.0;
while (1) {
QTextLine line = layout.createLine();
if (!line.isValid())
break;
line.setLineWidth(width());
line.setPosition(QPointF(0, y));
y += line.height();
}
layout.endLayout();
layout.draw(&p, QPoint(0, 0));
}
Then resize the width of the window to cause different line breaks. In Qt 4.8, it correctly does not break between the two lower case characters (where there's a string of nbsp chars), but in Qt 5 the nbsp is treated like regular spaces and it will break anywhere.
| For Gerrit Dashboard: QTBUG-39832 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 88172,4 | REG: Fix nbsp in QTextLayout | 5.3 | qt/qtbase | Status: ABANDONED | +2 | 0 |
| 88430,1 | REG: Fix nbsp in QTextLayout | dev | qt/qtbase | Status: DEFERRED | +2 | 0 |
| 88644,4 | REG: Fix nbsp in QTextLayout | 5.3 | qt/qtbase | Status: MERGED | +2 | 0 |