Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.5.1, 5.12
-
None
-
OSX 10.11.2 multiple monitors mixed retina and non-retina
Description
When multiple monitors present and one of them is retina and second is non retina:
What I expect
When I move application between displays icons change accordingly
What I have
On retina it looks ok, but when I move to non-retina display, icons looks terribly, because it only downscale from retina icons
Code works fine, when only one monitor is present. On retina it chooses high dpi icons on non-retina low dpi icons. Problem is only mixed multiple monitors.
#include <QtGui> #include <QtWidgets> int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); QTreeView treeView; QFileSystemModel model; treeView.setModel(&model); QModelIndex index = model.setRootPath("/"); treeView.setRootIndex(index); treeView.show(); return a.exec(); } #include "main.moc"
I also have tried to change it manually, but devicePixelRatio always gave me bad result. Maybe not prepared for mixed screens.
I expected
devicePixelRatio 2 for retina screen
and 1 for non retina screen
I got
Always 2 for all displays when retina monitor was present
void Window::moveEvent(QMoveEvent *event) { int number = QApplication::desktop()->screenNumber(this); auto screen = QApplication::desktop()->screen(number); qDebug() << screen->devicePixelRatio(); qDebug() << "screen number: " << number; qDebug() << "screen->devicePixelRatio();" << screen->devicePixelRatio(); qDebug() << "screen->logicalDpiY();" << screen->logicalDpiY(); }
Attachments
Issue Links
- relates to
-
QTBUG-77186 QIcon not using hi-res image on retina display
- Closed