Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-50251

OSX multiple monitors (retina + non-retina) icons on non-retina screen are downscaled.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15
    • 5.5.1, 5.12
    • GUI: High-DPI, QPA
    • None
    • OSX 10.11.2 multiple monitors mixed retina and non-retina
    • macOS

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              sorvig Morten Sørvig
              fbucek fbucek
              Votes:
              11 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes