-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.4.0, 6.5.3, 6.7.1
-
None
-
Windows 10
-
-
f7feed5ee (dev)
When a short (not tall) QTextEdit widget has placeholder text, the bottom pixels are clipped off. This is despite that the height is sufficient. To demonstrate this, execute the code below and note that the two QTextEdit widgets have the same text contents (at the same baseline), but the placeholder text is clipped. See attached screenshots.
#include <QSize>
#include <QLineEdit>
#include <QTextEdit>
const QSize size(QLineEdit{}.sizeHint());
QTextEdit textedit1, textedit2;
textedit1.setFixedSize(size);
textedit2.setFixedSize(size);
textedit1.setText(QStringLiteral("pQy"));
textedit2.setPlaceholderText(QStringLiteral("pQy"));
textedit1.move(10,0);
textedit1.move(50+size.width(),0);
textedit1.show(); // okay
textedit2.show(); // bottom pixels of text are clipped off
For Gerrit Dashboard: QTBUG-116016 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
617524,7 | QTextEdit: Use layout's bounding rect for placeholder text if possible | dev | qt/qtbase | Status: MERGED | +2 | 0 |