-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.11.3
-
None
-
linux x11
-
-
eb98bed4e76bb0fa6bad8474f2f370334cb70f6c (qt/qtbase/dev) dbffdb66544dd0c74a17b92487a79f5781c85057 (qt/qtbase/5.15)
When the device pixel ratio is greater than 1, use QLabel::setPixmap, the content of one pixel on the right and bottom side of the QLabel will be truncated
The following code is an example of mine.
QApplication app(argc, argv);
QWidget w;
QHBoxLayout hlayout;
QPixmap pix(98, 98);
QPainter p(&pix);
pix.fill(Qt::black);
p.setRenderHint(QPainter::Antialiasing);
p.setBrush(Qt::gray);
p.setPen(Qt::NoPen);
p.drawEllipse(0, 0, pix.width(), pix.height());
w.setLayout(&hlayout);
QLabel label1;
pix.setDevicePixelRatio(1.25);
label1.setPixmap(pix);
hlayout.addWidget(&label1);
QLabel label2;
pix.setDevicePixelRatio(1);
label2.setPixmap(pix);
hlayout.addWidget(&label2);
w.setPalette(QPalette(Qt::red));
w.show();
Compare the left side and the upper side, and you'll see the right side and the lower side are clearly truncated
- is duplicated by
-
QTBUG-86218 Incomplete image display due to scale
-
- Closed
-
| For Gerrit Dashboard: QTBUG-86170 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 310882,3 | Linux: Fix QLabel content truncated under high dpi | dev | qt/qtbase | Status: MERGED | +2 | 0 |
| 311762,2 | Linux: Fix QLabel content truncated under high dpi | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |