Software rendering in QQuickItem/QSGGeometryNode
Unsolved
QML and Qt Quick
-
I'm trying to draw a colored square in my custom QML component (QQuickItem).
QQuickItem::updatePaintNode similar code:
QSGGeometryNode *rect = new QSGGeometryNode(); QSGFlatColorMaterial *material = new QSGFlatColorMaterial(); QSGGeometry *geometry = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 4); QSGGeometry::updateRectGeometry(geometry, boundingRect()); material->setColor(QColor::red); rect->setMaterial(material); rect->setGeometry(geometry);
Example full project: https://file.io/icMlsHCeK8tb
I'm using software rendering like this:
QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
The problem is that the square is not drawn. If I turn on GPU rendering (OpenGL or Vulcan), then it works and I see a square. I am using Qt 6.6.0 from MaintenanceTool.
How to fix it?
-
@posix said in Software rendering in QQuickItem/QSGGeometryNode:
Example full project: