Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.0 Beta 3
-
None
Description
This code is in our tablet example qtbase/examples/widgets/widgets/tablet/tabletcanvas.cpp lines 300-316, to show a colored, rotating cursor in real time while a rotatable stylus is hovering over the Wacom tablet:
QImage origImg(QLatin1String(":/images/cursor-felt-marker.png"));
QImage img(32, 32, QImage::Format_ARGB32);
QColor solid = m_color;
solid.setAlpha(255);
img.fill(solid);
QPainter painter(&img);
QTransform transform = painter.transform();
transform.translate(16, 16);
transform.rotate(-event->rotation());
painter.setTransform(transform);
painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
painter.drawImage(-24, -24, origImg);
painter.setCompositionMode(QPainter::CompositionMode_HardLight);
painter.drawImage(-24, -24, origImg);
painter.end();
cursor = QCursor(QPixmap::fromImage(img), 16, 16);
I wrote it a few versions ago; it has been OK until now. (It was the first time I ever used composition modes though. And now it seems to cause this error:
blend_src_generic_rgb64 - blend_src_generic_rgb64: unsupported 64-bit blend attempted
Commenting out the setCompositionMode lines and just drawing the image once avoids the error.