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

QPainter drawImage displayed partially on QDeclarativeItem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.2.0
    • GUI: Painting
    • None
    • Windows 8.1

      I'm developing a new QML element in C++ based. My class NewQMLitem inherits from QDeclarativeItem and it's paint() method is responsible for drawing a QImage to the screen:

      void NewQMLitem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
      {
      // image is a QImage*
      painter->drawImage(0, 0, *image);
      }

      The code above works perfectly. However, when I pass X,Y coordinates to drawImage() other than zero, part of the resulting image is not updated correctly to the screen and appears filled with black.

      I attached a sample image to this post to illustrate the problem.

      My current workaround requires invoking widget->update() at the end of paint(), which is just terrible.

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

            sletta Gunnar Sletta
            karlphillip Karl Phillip
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes