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

Android QScreen::grabWindow(0) & sample code Screenshot::shootScreen() fails on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.4, 6.2.0 Alpha
    • 5.7.1, 5.9.1
    • Android
    • bacf9cd04c21c62075087febe0a799ed8d1c5f8c (qt/qtbase/dev)

    Description

      1) The Qt provided "screenshot" sample code demonstrates the failing grabWindow() behavior seen elsewhere on multiple Android platforms (have not yet found one that it works on). QScreen::grabWindow() always returns a null bitmap on Android.  See function shootScreen() in the Qt sample code.

      2) Attempts to use grabWindow() all fail on Android (Win32 works fine).

      • fails on NVIDIA Shield K1 (arm) running either Android 6 or 7.
      • fails on Panasonic FZ-B2D (x86) running Android 6.0.1
      • fails on ACER (x86) GT-810 running Android 5.1
      • fails on Juniper Systems Cedar (ARM) GT7G 7" running Android 6.0 

      3 Tried various permutations of winId()'s, screen geometry rect's, default parameters to try and find something combination that works.  No joy (but it all works on Windows, not Android).

      grabWindow(0)

      grabWindow(QApplication:desktop()->winID());

      grabWindow(QApplication.activeWindow()-winId(), rect.x(), rect.y()...).  etc...

      Attachments

        Issue Links

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

          Activity

            People

              piotrmi Piotr Mikolajczyk
              jakekirk jakekirk
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes