Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.5.0
-
None
-
Mac OSX 10.10 (retina)
Description
Try the following code. It will show that the pixmap on the label with scaled contents. You can enlarge the pixmap and see that when its width is 256 (2x as much) it will finally display properly onto the label. Interestingly it is only a problem in width, not in height.
I suppose that could be related to retina display
#include <QtGui> #include <QHBoxLayout> int main(int argc, char **argv) { QApplication app(argc, argv); QPixmap pix(128, 128); pix.fill(Qt::black); { QPainter p(&pix); QLinearGradient gradient(0, 0, 128, 128); gradient.setColorAt(0, Qt::red); gradient.setColorAt(1, Qt::blue); p.fillRect(0,0,128,128, gradient); } QWidget w; QHBoxLayout l; w.setLayout(&l); QLabel lbl1; lbl1.setPixmap(pix); lbl1.setScaledContents(false); l.addWidget(&lbl1); QLabel lbl2; lbl2.setPixmap(pix); lbl2.setScaledContents(true); l.addWidget(&lbl2); w.show(); return app.exec(); }
Attachments
Issue Links
- duplicates
-
QTBUG-46846 QLabel scaledContents broken on high resolution (retina) displays
- Closed
- relates to
-
QTBUG-49108 QLabel setpixmap is creating a pixmap several times larger than the label... (Regression)
- Closed