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

        1. image-2020-03-09-19-39-28-153.png
          177 kB
          Tor Arne Vestbø
        2. image-2020-03-09-19-39-39-104.png
          51 kB
          Tor Arne Vestbø
        3. image-2020-03-09-19-40-51-982.png
          28 kB
          Tor Arne Vestbø
        4. Screen Shot 2016-01-04 at 00.12.28.png
          32 kB
          fbucek
        5. Screen Shot 2016-01-04 at 00.12.39.png
          9 kB
          fbucek

        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