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

QPixmap::toImage() documentation issue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.6.0
    • 4.5.0
    • GUI: Painting
    • None
    • a7f377e8a20ee35d8bda55b2b13c9607f9ddfb3a

      The documentation for QPixmap::toImage() says
      "If the pixmap has greater than 8-bit depth, the returned image has 32-bit depth."

      While this is true on X11, it is not true for raster pixmaps, like on Qt/Embedded.
      On a 16 bit display, doing
      QPixmap::grabWidget(w).toImage();
      gives a 16 bit QImage, which contradicts the documentation.

      In Qt3 convertToImage() made it a 32 bit QImage indeed like the documentation says.
      So this is a double bug:

      • The above paragraph of documentation for toImage() should be explicit about "x11 only".
      • QT3_SUPPORT method convertToImage() shouldn't just call toImage(), it should also
        apply the qt3 logic of converting to ARGB32 if the depth is >= 8.

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

            sletta Gunnar Sletta
            ntg Pierre Rossi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes