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

Failure with QGraphicsPixmapItem::setOpacity and ::setVisible

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 5.11.2, 5.12
    • None
    • OS X 10.12.6, Qt 5.11.2
    • macOS

    Description

      There is a strange bug specific to OS X for Qt 5.11.2 (the bug does not exist in the older Qt 5.7.1 and does not occur on Windows or Linux for Qt 5.11.2).

      1. A QGraphicsPixmapItem becomes distorted (see screenshot 3) when calling QGraphicsPixmapItem::setOpacity() with opacity between 0.5 and 1.0. No distortion is noticeable when the opacity is <= 0.5.
      2. QGraphicsPixmapItem::setVisible(false) does not make the QGraphicsPixmapItem completely invisible. It is still partially visible until the underlying scene is updated a few more times.

      I am using OS X 10.12.6. This issue does not occur on Linux or Windows, just OS X.

      I have attached 3 screenshots:
      Screenshot 1. (as expected) a pixmap with opacity set to 0.5 using Qt 5.11.2
      Screenshot 2. (as expected) a pixmap with opacity set to 1.0 using Qt 5.7.1
      Screenshot 3. (unexpected) a pixmap with opacity set to 1.0 using Qt 5.11.2. The image is distorted and and smaller pixmaps which were set to invisible can still be seen (note images).

      The pixmap is created with the following code:

      std::vector<uint32_t> color_data;
      // ... [fill color_data]
      QImage image = QImage((const uchar*)&color_data.at(0), width, height, QImage::Format_RGB32).transformed(QMatrix().rotate(270));
      QPixmap pixmap;
      pixmap.convertFromImage(image);
      pixmaps_.push_back(pixmap);

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            quakkp Timothy Watson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes