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

QCocoaScreen::grabWindow doesn't work with retina and if an area is specified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.4.2, 5.9.8, 5.11
    • QPA
    • None
    • OS X 10.10.3 on a MacBook Pro with Retina display.
    • macOS

      The following example program is run on a Mac with retina display:

      #include <QApplication>
      #include <QWindow>
      #include <QScreen>
      #include <QPixmap>
      
      int main(int argc, char** argv)
      {
          QApplication a(argc, argv);
          QWindow win;
          QPixmap pm = win.screen()->grabWindow(0, 0, 0, 20, 30);
          pm.save("/tmp/a.png");
      }
      

      The saved image is of size 40x60 pixels which seems to be correct. But the displayed area is not the retina content, but rather the content of the logical coordinates 40x60 instead of the logcial coordinates 20x30.

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

            sorvig Morten Sørvig
            rms@froglogic.com Rainer
            Votes:
            8 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes