Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.0 RC1
-
None
-
Mac OSX 10.9.2
-
74a2e29705c283a6f52cf007a14a552cf529d051 8793ad8175191db9abfb9f034017b9a8fe095f5c
Description
I have two 24" monitors whose native resolution is 1900x1080.
If I run the attached test application, the two icons displayed in the dialog the application creates look correct (test_nohighres_monitor.png).
If I then change my left monitor's resolution to simulate a retina display (960x540 HiDPI) and restart the application, the icons look correct when the application is on the left (simulated HiDPI) monitor (test_highres_monitor.png) but if I move the application to the right, native resolution monitor, some icons look very bad (test_lowres_monitor.png, focus on the icon on right).
As you can see in the test application, for each image I have a regular version and a @2x version.
I would expect that when I move the application from the HiDPI monitor to the regular DPI monitor, the icon file being displayed would go from the @2x version to the regular version.
I'm not sure what is actually happening, however. It sort of looks like the 32x32 pixel @2x icon is being used but scaled down to 16x16 pixels, but not quite.
The code in the test application is:
int main(int argc, char *argv[]) { QApplication a(argc, argv); #if QT_VERSION >= 0x050100 a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); #endif QDialog modalD; modalD.setModal(true); // Create buttons. QPushButton* pb1 = new QPushButton(&modalD); pb1->setIcon(QIcon(":/Icons/go-home.png")); QPushButton* pb2 = new QPushButton(&modalD); pb2->setIcon(QIcon(":/Icons/x-office-document.png")); // Use a layout. QHBoxLayout* hLayout = new QHBoxLayout(); hLayout->addWidget(pb1); hLayout->addWidget(pb2); modalD.setLayout(hLayout); modalD.setWindowTitle("Modal dialog"); modalD.exec(); return a.exec(); }
Attachments
For Gerrit Dashboard: QTBUG-38100 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
82862,1 | WIP: Improve high-dpi QPushButton pixmap selection. | stable | qt/qtbase | Status: ABANDONED | 0 | 0 |
108770,3 | QCommonStyle: Select high-dpi pixmaps from icons | 5.5 | qt/qtbase | Status: ABANDONED | -2 | 0 |
108775,2 | QMacStyle: Select high-dpi pixmaps from icons | 5.5 | qt/qtbase | Status: ABANDONED | -2 | 0 |
127819,4 | QCommonStyle: Select high-dpi pixmaps from icons | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |
127820,4 | QMacStyle: Select high-dpi pixmaps from icons | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |