简体   繁体   中英

Add image to QQuickView

What I need to do is adding an image (available as a QImage object) to a custom QQuickItem. I override the updatePaintNode() function and add a couple of nodes, one of which should have a triangle-shaped child note. I´d like to achieve this by using an image of triangle contained in a png-file.

Is there any way to do this?

Sorry, I misunderstood your requirements. You need QQuickWindow::createTextureFromImage to create a QSGTexture, then a QSGSimpleTextureNode with the texture you just created, plus a QSGGeometry to define its geometry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM