-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.2.0
-
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.